From d664f64836c37ecf820e2af28fcb846c3299ce6c Mon Sep 17 00:00:00 2001
From: Coleman Watts
Date: Wed, 15 Jan 2014 12:55:01 -0800
Subject: [PATCH] CRM-11610 - Search js - Abstract table row highlight/select
---
CRM/Activity/Form/Search.php | 6 +-
CRM/Campaign/Form/Search.php | 6 +-
CRM/Case/Form/Activity.php | 2 +-
CRM/Case/Form/Search.php | 6 +-
CRM/Contact/Form/Merge.php | 2 +-
CRM/Contact/Form/Search.php | 6 +-
CRM/Contribute/Form/Search.php | 6 +-
CRM/Event/Form/Search.php | 6 +-
CRM/Grant/Form/Search.php | 6 +-
CRM/Member/Form/Search.php | 6 +-
CRM/Pledge/Form/Search.php | 6 +-
js/Common.js | 45 ++++++++-------
js/crm.searchForm.js | 55 -------------------
templates/CRM/Activity/Form/Selector.tpl | 8 ---
templates/CRM/Campaign/Form/Selector.tpl | 8 ---
templates/CRM/Case/Form/Selector.tpl | 7 ---
templates/CRM/Contact/Form/Search/Custom.tpl | 8 ---
.../Form/Search/Custom/ActivitySearch.tpl | 6 --
.../Form/Search/Custom/ContribSYBNT.tpl | 6 --
.../Search/Custom/ContributionAggregate.tpl | 5 --
.../Form/Search/Custom/EventDetails.tpl | 5 --
.../Form/Search/Custom/MultipleValues.tpl | 6 --
.../Contact/Form/Search/Custom/Proximity.tpl | 5 --
.../CRM/Contact/Form/Search/ResultTasks.tpl | 4 +-
templates/CRM/Contact/Form/Selector.tpl | 2 -
templates/CRM/Contribute/Form/Selector.tpl | 8 +--
templates/CRM/Event/Form/Selector.tpl | 8 +--
templates/CRM/Grant/Form/Selector.tpl | 8 +--
templates/CRM/Mailing/Form/Selector.tpl | 8 +--
templates/CRM/Member/Form/Selector.tpl | 8 +--
templates/CRM/Pledge/Form/Selector.tpl | 8 ---
templates/CRM/common/searchResultTasks.tpl | 2 +-
.../templates/ActivitySearch.tpl | 6 --
.../templates/MultipleValues.tpl | 6 --
34 files changed, 63 insertions(+), 227 deletions(-)
diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php
index 6f96900a3a..d6b9d2502e 100644
--- a/CRM/Activity/Form/Search.php
+++ b/CRM/Activity/Form/Search.php
@@ -237,12 +237,12 @@ class CRM_Activity_Form_Search extends CRM_Core_Form {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows')
);
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -263,7 +263,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all',
- array('onchange' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")
+ array('class' => 'select-rows', 'onchange' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );")
);
}
diff --git a/CRM/Campaign/Form/Search.php b/CRM/Campaign/Form/Search.php
index 03a60e5924..af40d5b1fb 100755
--- a/CRM/Campaign/Form/Search.php
+++ b/CRM/Campaign/Form/Search.php
@@ -262,11 +262,11 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form {
if (is_array($rows)) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -309,7 +309,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php
index 715e8ac658..eec34dd03e 100644
--- a/CRM/Case/Form/Activity.php
+++ b/CRM/Case/Form/Activity.php
@@ -321,7 +321,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
$this->addGroup($checkBoxes, 'contact_check');
$this->addElement('checkbox', 'toggleSelect', NULL, NULL,
- array('onclick' => "return toggleCheckboxVals('contact_check',this);")
+ array('class' => 'select-rows')
);
$this->assign('searchRows', $this->_relatedContacts);
}
diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php
index 0c32579b83..e637bb5efe 100644
--- a/CRM/Case/Form/Search.php
+++ b/CRM/Case/Form/Search.php
@@ -250,13 +250,13 @@ class CRM_Case_Form_Search extends CRM_Core_Form {
'toggleSelect',
NULL,
NULL,
- array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows')
);
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -285,7 +285,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php
index 8694ae9ffa..f53cddbc7a 100644
--- a/CRM/Contact/Form/Merge.php
+++ b/CRM/Contact/Form/Merge.php
@@ -213,7 +213,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
$this->_oid = $oid;
$this->_rgid = $rgid;
$this->_contactType = $main['contact_type'];
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "return toggleCheckboxVals('move_',this);"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows'));
$this->assign('mainLocBlock', json_encode($rowsElementsAndInfo['main_loc_block']));
$this->assign('rows', $rowsElementsAndInfo['rows']);
diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php
index 1a137cfee2..e6c0cd768e 100644
--- a/CRM/Contact/Form/Search.php
+++ b/CRM/Contact/Form/Search.php
@@ -517,7 +517,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form {
$this->assign_by_ref('selectedContactIds', $selectedContactIds);
- $allRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_', this);toggleTaskAction( true );toggleContactSelection( 'resetSel', '{$qfKeyParam}', 'reset' );"));
+ $allRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );toggleContactSelection( 'resetSel', '{$qfKeyParam}', 'reset' );"));
$this->assign('ts_all_id', $allRowsRadio->_attributes['id']);
/*
@@ -528,13 +528,13 @@ class CRM_Contact_Form_Search extends CRM_Core_Form {
$rows = $this->get('rows');
if (is_array($rows)) {
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true ); toggleCheckboxVals('mark_x_',this);return toggleContactSelection( 'toggleSelect', '" . $qfKeyParam . "' , 'multiple' );"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows', 'onclick' => "toggleTaskAction( true ); toggleContactSelection( 'toggleSelect', '" . $qfKeyParam . "' , 'multiple' );"));
$unselectedContactIds = array();
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleContactSelection( '" . $row['checkbox'] . "', '" . $qfKeyParam . "' , 'single' );toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleContactSelection( '" . $row['checkbox'] . "', '" . $qfKeyParam . "' , 'single' );toggleTaskAction( true );", 'class' => 'select-row')
);
if (!in_array($row['contact_id'], $selectedContactIds)) {
diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php
index 981d57af43..47ed3d7cfe 100644
--- a/CRM/Contribute/Form/Search.php
+++ b/CRM/Contribute/Form/Search.php
@@ -271,12 +271,12 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form {
'toggleSelect',
NULL,
NULL,
- array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows')
);
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -297,7 +297,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php
index 5423afc77c..463cefdcc3 100644
--- a/CRM/Event/Form/Search.php
+++ b/CRM/Event/Form/Search.php
@@ -241,7 +241,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form {
'toggleSelect',
NULL,
NULL,
- array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows')
);
}
foreach ($rows as $row) {
@@ -249,7 +249,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form {
if (!$this->_single) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
if (CRM_Event_BAO_Event::usesPriceSet($row['event_id'])) {
@@ -317,7 +317,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form {
array('checked' => 'checked')
);
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all',
- array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")
+ array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );")
);
}
diff --git a/CRM/Grant/Form/Search.php b/CRM/Grant/Form/Search.php
index 8399e8decf..2f03146217 100644
--- a/CRM/Grant/Form/Search.php
+++ b/CRM/Grant/Form/Search.php
@@ -230,11 +230,11 @@ class CRM_Grant_Form_Search extends CRM_Core_Form {
if (is_array($rows)) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onchange' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onchange' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('checkbox', CRM_Utils_Array::value('checkbox', $row),
NULL, NULL,
- array('onclick' => " toggleTaskAction( true ); return checkSelectedBox('" . CRM_Utils_Array::value('checkbox', $row) . "');")
+ array('onclick' => " toggleTaskAction( true );", 'class' => 'select-row')
);
$grant_id = $row['grant_id'];
}
@@ -260,7 +260,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onchange' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onchange' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php
index 4c575a4991..e78d43a2e4 100644
--- a/CRM/Member/Form/Search.php
+++ b/CRM/Member/Form/Search.php
@@ -226,11 +226,11 @@ class CRM_Member_Form_Search extends CRM_Core_Form {
if (is_array($rows)) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -251,7 +251,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php
index c5df525e34..55b94e9736 100644
--- a/CRM/Pledge/Form/Search.php
+++ b/CRM/Pledge/Form/Search.php
@@ -224,12 +224,12 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form {
if (is_array($rows)) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
- $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);"));
+ $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'],
NULL, NULL,
- array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');")
+ array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row')
);
}
}
@@ -251,7 +251,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form {
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
- $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
+ $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
diff --git a/js/Common.js b/js/Common.js
index 31cdfcddb6..4dc1b47074 100644
--- a/js/Common.js
+++ b/js/Common.js
@@ -255,26 +255,23 @@ CRM.validate = CRM.validate || {
(function ($, undefined) {
"use strict";
- $(document).ready(function () {
- $().crmtooltip();
- $('.crm-container table.row-highlight').on('change', 'input.select-row, input.select-rows', function () {
- var target, table = $(this).closest('table');
- if ($(this).hasClass('select-rows')) {
- target = $('tbody tr', table);
- $('input.select-row', table).prop('checked', $(this).prop('checked'));
- }
- else {
- target = $(this).closest('tr');
- $('input.select-rows', table).prop('checked', $(".select-row:not(':checked')", table).length < 1);
- }
- target.toggleClass('crm-row-selected', $(this).is(':checked'));
- });
- $('body').on('click', function (event) {
- $('.btn-slide-active').removeClass('btn-slide-active').find('.panel').hide();
- if ($(event.target).is('.btn-slide')) {
- $(event.target).addClass('btn-slide-active').find('.panel').show();
- }
- });
+
+ $(document).on('crmLoad', function(e) {
+ $('table.row-highlight', e.target)
+ .off('.rowHighlight')
+ .on('change.rowHighlight', 'input.select-row, input.select-rows', function () {
+ var target, table = $(this).closest('table');
+ if ($(this).hasClass('select-rows')) {
+ target = $('tbody tr', table);
+ $('input.select-row', table).prop('checked', $(this).prop('checked'));
+ }
+ else {
+ target = $(this).closest('tr');
+ $('input.select-rows', table).prop('checked', $(".select-row:not(':checked')", table).length < 1);
+ }
+ target.toggleClass('crm-row-selected', $(this).is(':checked'));
+ })
+ .find('input.select-row:checked').parents('tr').addClass('crm-row-selected');
});
/**
@@ -869,6 +866,14 @@ CRM.validate = CRM.validate || {
);
return false;
});
+
+ $().crmtooltip();
+ $('body').on('click', function (event) {
+ $('.btn-slide-active').removeClass('btn-slide-active').find('.panel').hide();
+ if ($(event.target).is('.btn-slide')) {
+ $(event.target).addClass('btn-slide-active').find('.panel').show();
+ }
+ });
});
$.fn.crmAccordions = function (speed) {
diff --git a/js/crm.searchForm.js b/js/crm.searchForm.js
index 86ccad87f5..df5a2a7db0 100644
--- a/js/crm.searchForm.js
+++ b/js/crm.searchForm.js
@@ -22,25 +22,6 @@ cj(function($) {
});
});
-/**
- *
- * Function for checking ALL or unchecking ALL check boxes in a resultset page.
- *
- * @access public
- * @param fldPrefix - common string which precedes unique checkbox ID and identifies field as
- * belonging to the resultset's checkbox collection
- * @param object - checkbox
- * Sample usage: onClick="javascript:changeCheckboxValues('chk_', cj(this) );"
- *
- * @return
- */
-function toggleCheckboxVals(fldPrefix, object) {
- var val = (object.id == 'toggleSelect' && cj(object).is(':checked'));
- cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').prop('checked', val);
- // change the class of selected rows
- on_load_init_checkboxes(object.form.name);
-}
-
function countSelectedCheckboxes(fldPrefix, form) {
fieldCount = 0;
for (i = 0; i < form.elements.length; i++) {
@@ -52,42 +33,6 @@ function countSelectedCheckboxes(fldPrefix, form) {
return fieldCount;
}
-/**
- * This function changes the style for a checkbox block when it is selected.
- *
- * @access public
- * @param chkName - it is name of the checkbox
- * @return null
- */
-function checkSelectedBox(chkName) {
- var checkElement = cj('#' + chkName);
- if (checkElement.prop('checked')) {
- cj('input[value=ts_sel]:radio').prop('checked', true);
- checkElement.parents('tr').addClass('crm-row-selected');
- }
- else {
- checkElement.parents('tr').removeClass('crm-row-selected');
- }
-}
-
-/**
- * This function is to show the row with selected checkbox in different color
- * @param form - name of form that checkboxes are part of
- *
- * @access public
- * @return null
- */
-function on_load_init_checkboxes(form) {
- var formName = form;
- var fldPrefix = 'mark_x';
- for (i = 0; i < document.forms[formName].elements.length; i++) {
- fpLen = fldPrefix.length;
- if (document.forms[formName].elements[i].type == 'checkbox' && document.forms[formName].elements[i].name.slice(0, fpLen) == fldPrefix) {
- checkSelectedBox(document.forms[formName].elements[i].name, formName);
- }
- }
-}
-
/**
* This function is used to check if any action is selected and also to check if any contacts are checked.
*
diff --git a/templates/CRM/Activity/Form/Selector.tpl b/templates/CRM/Activity/Form/Selector.tpl
index b0512a7775..512ee840d2 100644
--- a/templates/CRM/Activity/Form/Selector.tpl
+++ b/templates/CRM/Activity/Form/Selector.tpl
@@ -119,14 +119,6 @@
{include file="CRM/Case/Form/ActivityToCase.tpl"}
-{if $context EQ 'Search'}
-
-{/if}
-
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
{/if}
diff --git a/templates/CRM/Campaign/Form/Selector.tpl b/templates/CRM/Campaign/Form/Selector.tpl
index fef0491674..0e852a617e 100755
--- a/templates/CRM/Campaign/Form/Selector.tpl
+++ b/templates/CRM/Campaign/Form/Selector.tpl
@@ -73,14 +73,6 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
-
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
{/if}
diff --git a/templates/CRM/Case/Form/Selector.tpl b/templates/CRM/Case/Form/Selector.tpl
index dcd09aa995..e0736b1eba 100644
--- a/templates/CRM/Case/Form/Selector.tpl
+++ b/templates/CRM/Case/Form/Selector.tpl
@@ -131,13 +131,6 @@
-{if $context EQ 'Search'}
-
-{/if}
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom.tpl b/templates/CRM/Contact/Form/Search/Custom.tpl
index 3b1ab45a3c..86fe27f4e2 100644
--- a/templates/CRM/Contact/Form/Search/Custom.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom.tpl
@@ -118,12 +118,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
@@ -175,8 +169,6 @@ function toggleContactSelection( name, qfKey, selection ){
{/foreach}
{literal}
cj("#toggleSelect").prop('checked', false);
- var formName = "{/literal}{$form.formName}{literal}";
- on_load_init_checkboxes(formName);
}
return false;
}
diff --git a/templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl b/templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl
index 79fb5b9b49..2cfe61f788 100644
--- a/templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl
@@ -129,12 +129,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl b/templates/CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl
index 6ac064d461..747f9354ec 100644
--- a/templates/CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl
@@ -139,12 +139,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl b/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
index be5849448e..20d62122d6 100644
--- a/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
@@ -128,11 +128,6 @@
{/strip}
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom/EventDetails.tpl b/templates/CRM/Contact/Form/Search/Custom/EventDetails.tpl
index 919febd079..44ad7d7911 100644
--- a/templates/CRM/Contact/Form/Search/Custom/EventDetails.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/EventDetails.tpl
@@ -134,11 +134,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom/MultipleValues.tpl b/templates/CRM/Contact/Form/Search/Custom/MultipleValues.tpl
index 86fa96aeef..c550d089b5 100644
--- a/templates/CRM/Contact/Form/Search/Custom/MultipleValues.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/MultipleValues.tpl
@@ -94,12 +94,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/Custom/Proximity.tpl b/templates/CRM/Contact/Form/Search/Custom/Proximity.tpl
index a49b22d6b4..089d3fb909 100644
--- a/templates/CRM/Contact/Form/Search/Custom/Proximity.tpl
+++ b/templates/CRM/Contact/Form/Search/Custom/Proximity.tpl
@@ -113,11 +113,6 @@
{/strip}
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Contact/Form/Search/ResultTasks.tpl b/templates/CRM/Contact/Form/Search/ResultTasks.tpl
index 61cec069e9..880ed11c53 100644
--- a/templates/CRM/Contact/Form/Search/ResultTasks.tpl
+++ b/templates/CRM/Contact/Form/Search/ResultTasks.tpl
@@ -94,6 +94,8 @@
{literal}
{/literal}
diff --git a/templates/CRM/Contact/Form/Selector.tpl b/templates/CRM/Contact/Form/Selector.tpl
index c218769f9c..ba2a5acee9 100644
--- a/templates/CRM/Contact/Form/Selector.tpl
+++ b/templates/CRM/Contact/Form/Selector.tpl
@@ -161,7 +161,6 @@
}
var params = {getCount: cids.length};
countSelections(params);
- on_load_init_checkboxes("{/literal}{$form.formName}{literal}");
});
function countSelections(obj) {
var label = cj('label[for*=ts_sel]');
@@ -177,7 +176,6 @@ function countSelections(obj) {
}
toggleTaskAction(obj.getCount);
}
- on_load_init_checkboxes("{/literal}{$form.formName}{literal}");
}
function toggleContactSelection(name, qfKey, selection) {
var url = CRM.url('civicrm/ajax/markSelection');
diff --git a/templates/CRM/Contribute/Form/Selector.tpl b/templates/CRM/Contribute/Form/Selector.tpl
index cf9dde368d..6074f84d5d 100644
--- a/templates/CRM/Contribute/Form/Selector.tpl
+++ b/templates/CRM/Contribute/Form/Selector.tpl
@@ -93,13 +93,7 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
+
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Event/Form/Selector.tpl b/templates/CRM/Event/Form/Selector.tpl
index c22727f2c7..681a55fefa 100644
--- a/templates/CRM/Event/Form/Selector.tpl
+++ b/templates/CRM/Event/Form/Selector.tpl
@@ -100,13 +100,7 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
+
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Grant/Form/Selector.tpl b/templates/CRM/Grant/Form/Selector.tpl
index d765234721..d542ec8c17 100644
--- a/templates/CRM/Grant/Form/Selector.tpl
+++ b/templates/CRM/Grant/Form/Selector.tpl
@@ -78,13 +78,7 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
+
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Mailing/Form/Selector.tpl b/templates/CRM/Mailing/Form/Selector.tpl
index 824e64c4e0..fb490b48c2 100644
--- a/templates/CRM/Mailing/Form/Selector.tpl
+++ b/templates/CRM/Mailing/Form/Selector.tpl
@@ -67,13 +67,7 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
+
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Member/Form/Selector.tpl b/templates/CRM/Member/Form/Selector.tpl
index 4926ea5b4a..74c3a53911 100644
--- a/templates/CRM/Member/Form/Selector.tpl
+++ b/templates/CRM/Member/Form/Selector.tpl
@@ -90,13 +90,7 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
+
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/templates/CRM/Pledge/Form/Selector.tpl b/templates/CRM/Pledge/Form/Selector.tpl
index 39b5372be1..1c787b1bee 100644
--- a/templates/CRM/Pledge/Form/Selector.tpl
+++ b/templates/CRM/Pledge/Form/Selector.tpl
@@ -106,14 +106,6 @@
{/strip}
-{if $context EQ 'Search'}
-
-{/if}
-
{if $context EQ 'Search'}
{include file="CRM/common/pager.tpl" location="bottom"}
{/if}
diff --git a/templates/CRM/common/searchResultTasks.tpl b/templates/CRM/common/searchResultTasks.tpl
index f217c9c571..83e39c4126 100644
--- a/templates/CRM/common/searchResultTasks.tpl
+++ b/templates/CRM/common/searchResultTasks.tpl
@@ -78,8 +78,8 @@
{literal}
-
{include file="CRM/common/pager.tpl" location="bottom"}
diff --git a/tools/extensions/org.civicrm.search.multivalue/templates/MultipleValues.tpl b/tools/extensions/org.civicrm.search.multivalue/templates/MultipleValues.tpl
index 980454dcc6..fbdc38069c 100644
--- a/tools/extensions/org.civicrm.search.multivalue/templates/MultipleValues.tpl
+++ b/tools/extensions/org.civicrm.search.multivalue/templates/MultipleValues.tpl
@@ -125,12 +125,6 @@
{/strip}
-
-
{include file="CRM/common/pager.tpl" location="bottom"}
--
2.25.1