Swap out button/submit inputs for button elements
authorAndrew Hunt <andrew@aghstrategies.com>
Thu, 6 Aug 2020 15:19:56 +0000 (11:19 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Tue, 8 Sep 2020 19:31:01 +0000 (15:31 -0400)
35 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
install/template.html
js/jquery/jquery.dashboard.js
setup/plugins/blocks/advanced.tpl.php
setup/plugins/blocks/install.tpl.php
setup/plugins/blocks/requirements.tpl.php
setup/src/Setup/UI/SetupController.php
templates/CRM/Block/Add.tpl
templates/CRM/Block/FullTextSearch.tpl
templates/CRM/Contact/Page/View/Print.tpl
templates/CRM/Mailing/Page/Resubscribe.tpl
templates/CRM/common/navigation.js.tpl

index 775fa2c04ec57cd741a37d0f837fc4884a88ce70..41073eed625e50e5358bab6f69d111a14b482303 100644 (file)
@@ -50,7 +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('submit', 'ckeditor_config', ts('Configure CKEditor'));
+    $this->addElement('xbutton', 'ckeditor_config', ts('Configure CKEditor'), ['type' => 'submit']);
 
     $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
     $this->assign('editOptions', $editOptions);
index da909c7f0877817e205df640f1c17df749179c8e..1c6dc0d46aa8de6f2eb1a6d0b595073e15639fb7 100644 (file)
@@ -61,7 +61,11 @@ 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('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']);
+    $attrs = [
+      'type' => 'submit',
+      'crm-icon' => 'fa-envelope-o',
+    ];
+    $buttons[] = $this->createElement('xbutton', $this->_testButtonName, ts('Save & Send Test Email'), $attrs);
     $this->getElement('buttons')->setElements($buttons);
 
     if (!empty($setStatus)) {
index e60ababdb45cb910fe6a7ee20aa794e54c5e4d70..8e1a3022f48715d30f6412eaf86a698808a19c83 100644 (file)
@@ -173,9 +173,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
     // 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']
     );
 
     $this->addButtons([
index 7c9724a53c83671ca4ee97eec12fc5168257bb3c..f2300dadb23e11ae16d1cd37e48ea083b48aa6de 100644 (file)
@@ -275,7 +275,10 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     // This button is hidden but gets clicked by javascript at
     // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L194
     // by the onChange handler for the above timeline_id select.
-    $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']);
+    $this->addElement('xbutton', $this->getButtonName('next'), ' ', [
+      'class' => 'hiddenElement',
+      'type' => 'submit',
+    ]);
 
     $this->buildMergeCaseForm();
 
@@ -523,11 +526,12 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
       // This button is hidden but gets clicked by javascript at
       // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L55
       // when the mergeCasesDialog is saved.
-      $this->addElement('submit',
+      $this->addElement('xbutton',
         $this->getButtonName('next', 'merge_case'),
         ts('Merge'),
         [
           'class' => 'hiddenElement',
+          'type' => 'submit',
         ]
       );
     }
index 04e3c8a897e79f52c58a27b38d60bf73bbe1ef31..5d6ce311bc834f1756c9f256a947441e3dd19a0f 100644 (file)
@@ -808,17 +808,20 @@ 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('submit',
+    $this->addElement('xbutton',
       $this->_dedupeButtonName,
-      ts('Check for Matching Contact(s)')
+      ts('Check for Matching Contact(s)'),
+      ['type' => 'submit']
     );
-    $this->addElement('submit',
+    $this->addElement('xbutton',
       $this->_duplicateButtonName,
-      ts('Save Matching Contact')
+      ts('Save Matching Contact'),
+      ['type' => 'submit']
     );
-    $this->addElement('submit',
+    $this->addElement('xbutton',
       $this->getButtonName('next', 'sharedHouseholdDuplicate'),
-      ts('Save With Duplicate Household')
+      ts('Save With Duplicate Household'),
+      ['type' => 'submit']
     );
 
     $buttons = [
index 25c95ac6b7ebbb541e47d2d629604db82fad4673..af5e9f8213108387eaf0a4e58bc3e3ce3e09e2b9 100644 (file)
@@ -469,8 +469,9 @@ 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('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',
         ]
       );
index f98aa34e324ff2c48164eed1f66bf3cf5b09734f..ac69e5e142543d5b8a9c8ed72ca9b6b2ff55846c 100644 (file)
@@ -65,8 +65,12 @@ 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);
-    $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',
+    ];
+    $this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs);
+    $this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs);
     $this->addButtons([
       [
         'type' => 'next',
index ba8bb64ec08706d24b8822fe9dc816d4af568f4b..76e245eabdb77d787ffb02798bfb19176abe2f00 100644 (file)
@@ -222,7 +222,10 @@ 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('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
index 7c6ee1bb991cdef4b2a58bcf694f71b1c32760fa..77cdd5094a9729ccf6cf53f419d3a89699795601 100644 (file)
@@ -188,9 +188,10 @@ 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('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);
index f1c72357c7bf9c41b5158909bff8c4db3262f816..6833eafd0e252eba747ee44b164bd80b4aa7094e 100644 (file)
@@ -38,7 +38,10 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Import_Form_DataSource {
 
     $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();
   }
index e2e0e7057a29de51be7091621772fe334e24e630..58b573c3f807a27af89ee4362b58d2577277c7d1 100644 (file)
@@ -318,8 +318,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     $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',
+      ]
     );
 
     $contactTypes = CRM_Contact_BAO_ContactType::basicTypes();
@@ -553,7 +556,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         $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',
+      ]);
     }
     //end of block for
 
index 98526b5a8198102ab15a687c1b8f98faed0d2a9f..8a48473c019a228343c1dedd53c1a88229840169 100644 (file)
@@ -686,7 +686,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       }
 
       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'])) {
@@ -709,7 +710,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
           $attrs['crm-icon'] = $icon;
         }
         $buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button));
-        $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs);
+        $attrs['type'] = 'submit';
+        $prevnext[] = $this->createElement('xbutton', $buttonName, $button['name'], $attrs);
       }
       if (!empty($button['isDefault'])) {
         $this->setDefaultAction($button['type']);
@@ -2448,7 +2450,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         $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']);
index 840650e7d9f754ea778b79b4614323529a8cd3fe..af6ca363cbe7ba30bacf4bc8f49cb58b8304e5a0 100644 (file)
@@ -565,10 +565,13 @@ 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('button',
+      $this->addElement('xbutton',
         'done',
         ts('Done'),
-        ['onclick' => "location.href='$url'"]
+        [
+          'type' => 'button',
+          'onclick' => "location.href='$url'",
+        ]
       );
     }
   }
index 0c37d9037416f3bc3158bc17170bd53eab0d8013..09cffc753310635b4b1002abeb9c9fa8abba058c 100644 (file)
@@ -351,7 +351,10 @@ 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('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'",
+      ]);
     }
   }
 
index 3bb6a5fb6c0430adc52370d250a4143bfe58cf5d..054df625296202055000a16297c7ef8d72373ad8 100644 (file)
@@ -201,10 +201,15 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
           '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']
+          [
+            'type' => 'button',
+            'onclick' => "location.href='$url'",
+            'class' => 'crm-form-submit cancel',
+            'crm-icon' => 'fa-times',
+          ]
         );
       }
     }
index 40b40fc9126e655739992dda15e0c02448771af1..78fdadaf6230b50eb48274210feefc3c5383de4a 100644 (file)
@@ -355,8 +355,11 @@ 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('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',
+      ]
     );
     if (Civi::settings()->get('deferred_revenue_enabled')) {
       $deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType();
index 408a84e729118d37b93e14580c91f1a9c0600dc7..20848b58ecae0de326618eb1771b00d8ab0b7591 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('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 @@ 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('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 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
       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 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
       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',
       ]);
index 985d9ddfbb672383331ddf9247b5c97132193e14..069c6e0a9abdbf9a21f17a6e1ce0554df208d2c5 100644 (file)
@@ -93,8 +93,9 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
       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',
       ]);
index 571ab77be16ee7158efc542d658b88fa9d98a4c6..aed5e90a8d8ec028d836069cdc1ec5a0301dfba2 100644 (file)
@@ -376,10 +376,13 @@ 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('button',
+      $this->addElement('xbutton',
         'done',
         ts('Done'),
-        ['onclick' => "location.href='$url'"]
+        [
+          'type' => 'button',
+          'onclick' => "location.href='$url'",
+        ]
       );
     }
   }
index 8d8f46cd881fd97464027f1e7475434d0a3c5e5a..c34f1388dd6768b63099dec07c5bbf877cfdd9bb 100644 (file)
@@ -904,9 +904,10 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
     if ($this->_context == 'dialog') {
       $this->addElement(
-        'submit',
+        'xbutton',
         $this->_duplicateButtonName,
-        ts('Save Matching Contact')
+        ts('Save Matching Contact'),
+        ['type' => 'submit']
       );
     }
   }
index 7564dc37fc280614971c140e895fd706ebbcc6bf..16bc4a31eba941762802467dff98da3d7a2ceac4 100644 (file)
@@ -209,7 +209,7 @@ SELECT module,is_reserved
 
     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']);
 
       return;
     }
index aaf8bb15fd2f57656f0eba86adc208ed8541e427..1099be3bb0eca5c04c7c70a92eab408603647cc9 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('submit', $this->_chartButtonName, ts('View'));
+      $this->addElement('xbutton', $this->_chartButtonName, ts('View'), ['type' => 'submit']);
     }
   }
 
@@ -1660,7 +1660,10 @@ class CRM_Report_Form extends CRM_Core_Form {
       $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();
index 4bfcb214af81150eddebdc9b685c6a948d8218f7..997962cd40b1f77cd35c80b4f1167b66310712b0 100644 (file)
@@ -467,8 +467,11 @@ 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('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 . "'",
+        ]
       );
     }
 
index a9fef4dc8fef3722bc6db7a0ab440bb258fa02a2..5a4d3dd570a5e70c57dcd27212e2bd10ad002db7 100644 (file)
@@ -231,7 +231,10 @@ 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('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);
index e95165536b2e43f38345a7bf038babac463aa261..eb12944d220edf6b705eb18a9b4fbcd713cc5080 100644 (file)
@@ -34,7 +34,7 @@ if ($text_direction == 'rtl') {
   <?php } ?>
 
   <p>
-  <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')); ?>'" />
+  <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>
 
   <span id="saving_top" style="display: none">
   &nbsp;
@@ -73,7 +73,7 @@ if ($text_direction == 'rtl') {
   ?>
 </select>
 <noscript>
-  <input type="submit" name="setlanguage" value="<?php echo ts('Change language', array('escape' => 'js')); ?>" />
+  <button type="submit" name="setlanguage"><?php echo ts('Change language', ['escape' => 'js']); ?></button>
 </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"><input type="submit" value="<?php echo ts('Re-check requirements', array('escape' => 'js')); ?>" /></p>
+<p style="margin-left: 2em"><button type="submit"><?php echo ts('Re-check requirements', ['escape' => 'js']); ?></button></p>
 
 <a name="dbDetails">
 
index 4191285449bac84b76339fa5c142b87c4a65ae9d..00c65260ec2fea76b26dac96fd512500c35c7316 100644 (file)
         html += '<form class="widget-settings">';
         html += '  <div class="widget-settings-inner"></div>';
         html += '  <div class="widget-settings-buttons">';
-        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 += '    <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 += '  </div>';
         html += '</form>';
         return html;
index 971d22c1fd5a3fcdc59c00878e969ed806ef1831..abfc0392604922e9ef9663e0eed42870d09358e0 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']); ?>">
-          <input id="db_apply_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Apply')); ?>" />
+          <button id="db_apply_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Apply')); ?></button>
           <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 81e005f1ab7b5ed4a3f3e5a9f1d48a5de119f0db..7785ad2aae5edcf593d9ca3ab9d6afab93dd1e98 100644 (file)
@@ -1,9 +1,8 @@
 <?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n");
 endif; ?>
 <div class="action-box">
-  <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')); ?>'"/>
+  <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>
   <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 54979fdf3c87564e3a7846f897450c23e0da9f8d..844406249be3738a066b0274459a3d093f72a38d 100644 (file)
@@ -46,7 +46,7 @@ uasort($msgs, function($a, $b) {
 </table>
 
 <div class="action-box">
-  <input id="recheck_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Refresh')); ?>" />
+  <button id="recheck_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Refresh')); ?></button>
   <div class="advancedTip">
     <?php echo ts('After updating your system, refresh to test the requirements again.'); ?>
   </div>
index c7e685f9fff8ffc7720dfcaf122ee5c375c13a66..022929552816a5cb5f39bc6f265ee7f456a60916 100644 (file)
@@ -247,7 +247,7 @@ class SetupController implements SetupControllerInterface {
    *
    * @param array $fields
    *   HTTP inputs -- e.g. with a form element like this:
-   *   `<input type="submit" name="civisetup[action][Foo]" value="Do the foo">`
+   *   `<button type="submit" name="civisetup[action][Foo]">Do the foo</button>`
    * @param string $default
    *   The action-name to return if no other action is identified.
    * @return string
index dd4f36735a8e47ad51ed7f554771fb8af5bb4c59..00bf545715ad9a8661b8d863a0d3612742197607 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"><input type="submit" name="_qf_Contact_next" value="{ts}Save{/ts}" class="crm-form-submit" /></div>
+<div class="form-item"><button type="submit" name="_qf_Contact_next" class="crm-button crm-form-submit">{ts}Save{/ts}</button></div>
 
 </form>
 </div>
index 4f85ad1ba25851cd7e47f25331c056127eff04ae..b076bc2f3a1f2d1c6d63a980f9e7c9474194b988 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;<input type="submit" name="submit" id="fulltext_submit" value="{ts}Go{/ts}" class="crm-form-submit"/ onclick='submitForm();'>
+    <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="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Controller_Search' addSequence=1}" />
   </div>
   <select class="form-select" id="fulltext_table" name="fulltext_table">
index 1fb9798cc53f151a7e20d59f9a8f33be5df50c36..6031bf210b8f9c33b14aba9a91915cd312768b5c 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"><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>
+       <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>
   </div>
 </form>
 <br />
index 47b413d078af6abc0ca1c9be8b891d9131b45b19..98c0f9f3be0027be61e50c5380b36bc448508eef 100644 (file)
@@ -18,9 +18,9 @@
 {ts 1=$display_name 2=$email}Are you sure you want to resubscribe: %1 (%2){/ts}
 <br/>
 <center>
-<input type="submit" name="_qf_resubscribe_next" value="{ts}Resubscribe{/ts}" class="crm-form-submit" />
+<button type="submit" name="_qf_resubscribe_next" class="crm-button crm-form-submit">{ts}Resubscribe{/ts}</button>
 &nbsp;&nbsp;&nbsp;
-<input type="submit" name="_qf_resubscribe_cancel" value="{ts}Cancel{/ts}" class="crm-form-submit" />
+<button type="submit" name="_qf_resubscribe_cancel" class="crm-button crm-form-submit">{ts}Cancel{/ts}</button>
 </center>
 </form>
 </div>
index 866769185c51e2d61c862b3577e5ac1490019480..5ec824a85e46250e75f26587a78cf8def7fabcc7 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;"><input type="submit" value="{ts}Go{/ts}" name="_qf_Advanced_refresh" class="crm-form-submit default" /></div>
+            <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>
         </form>
         <ul>