CRM-11610 - Search js - Abstract table row highlight/select
authorColeman Watts <coleman@civicrm.org>
Wed, 15 Jan 2014 20:55:01 +0000 (12:55 -0800)
committerColeman Watts <coleman@civicrm.org>
Fri, 24 Jan 2014 06:24:07 +0000 (22:24 -0800)
34 files changed:
CRM/Activity/Form/Search.php
CRM/Campaign/Form/Search.php
CRM/Case/Form/Activity.php
CRM/Case/Form/Search.php
CRM/Contact/Form/Merge.php
CRM/Contact/Form/Search.php
CRM/Contribute/Form/Search.php
CRM/Event/Form/Search.php
CRM/Grant/Form/Search.php
CRM/Member/Form/Search.php
CRM/Pledge/Form/Search.php
js/Common.js
js/crm.searchForm.js
templates/CRM/Activity/Form/Selector.tpl
templates/CRM/Campaign/Form/Selector.tpl
templates/CRM/Case/Form/Selector.tpl
templates/CRM/Contact/Form/Search/Custom.tpl
templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl
templates/CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl
templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
templates/CRM/Contact/Form/Search/Custom/EventDetails.tpl
templates/CRM/Contact/Form/Search/Custom/MultipleValues.tpl
templates/CRM/Contact/Form/Search/Custom/Proximity.tpl
templates/CRM/Contact/Form/Search/ResultTasks.tpl
templates/CRM/Contact/Form/Selector.tpl
templates/CRM/Contribute/Form/Selector.tpl
templates/CRM/Event/Form/Selector.tpl
templates/CRM/Grant/Form/Selector.tpl
templates/CRM/Mailing/Form/Selector.tpl
templates/CRM/Member/Form/Selector.tpl
templates/CRM/Pledge/Form/Selector.tpl
templates/CRM/common/searchResultTasks.tpl
tools/extensions/org.civicrm.search.activity/templates/ActivitySearch.tpl
tools/extensions/org.civicrm.search.multivalue/templates/MultipleValues.tpl

index 6f96900a3a2a9819c7d907f6ea2974e76d308ac7..d6b9d2502ef3fbd0163f643f61d2f69a3de3806e 100644 (file)
@@ -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 );")
       );
     }
 
index 03a60e592464143f37220b524023844214ebdbcc..af40d5b1fbc0ca2db6ea1bb109e30e0a4786d575 100755 (executable)
@@ -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
index 715e8ac658a50269cd1957c0006b780014536751..eec34dd03e21bc2d4dc48121d08934aaa9d02ba3 100644 (file)
@@ -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);
     }
index 0c32579b831eef268c070d0958a95e73f6f01f69..e637bb5efe7f32e42af3944ee8445f33e851468e 100644 (file)
@@ -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
index 8694ae9ffa865bb895ae257cd302a187c8f35816..f53cddbc7ad21c663526a5c6e24d2e2d4c6b5e1e 100644 (file)
@@ -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']);
index 1a137cfee2ebf2827ef1dbdc59a4b3e5029f49f0..e6c0cd768e73330da08009595b8ae45a9cab4e6a 100644 (file)
@@ -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)) {
index 981d57af4391a4c65f5ca94a4af291513d317883..47ed3d7cfe5ad2d9220da83978c4b57a4c0a8aef 100644 (file)
@@ -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
index 5423afc77ca752fdac17666f7833922260ea58b4..463cefdcc38c61dd00bde126a131a24dced848c2 100644 (file)
@@ -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 );")
       );
     }
 
index 8399e8decfef70a1fc669064d965a4be502958c4..2f03146217712d9af516b1636f740579930e3d3f 100644 (file)
@@ -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
index 4c575a49913001feb72b1fe707ef588a3c4edd98..e78d43a2e465b37c2cbf387c9df9816aa5bba97c 100644 (file)
@@ -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 );"));
     }
 
 
index c5df525e34303b35ad403f32ebd1b6631834f4a5..55b94e9736c6d6eb3471e3535a8cf875d6e69b6c 100644 (file)
@@ -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
index 31cdfcddb642813aca3801993aa6c64d52ac659f..4dc1b47074135d6f6576611ab868d9909b5abd22 100644 (file)
@@ -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) {
index 86ccad87f5052e8aed44f45980183e1621e4212c..df5a2a7db0fafc135822fc9cc67505612a46115c 100644 (file)
@@ -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.
  *
index b0512a7775416f97db0ee41e9c7135ed01ef6ec0..512ee840d23ed0c719cf1ec936c256efcd498ec0 100644 (file)
 {include file="CRM/Case/Form/ActivityToCase.tpl"}
 
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
-
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
 {/if}
index fef0491674e2c245716b588377e87d59f035a4cd..0e852a617ed7e0c31ba6e34526220842d170d500 100755 (executable)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
-
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
 {/if}
index dcd09aa9953faeb060b94383bceb680a1710f47e..e0736b1ebaadadfb71967cb7d01250bf00f24bb6 100644 (file)
 <div id="view-activity" style="display:none;">
      <div id="activity-content"></div>
 </div>
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index 3b1ab45a3c9f0175e4370f85970c3d1726883bfb..86fe27f4e2fbdd7eab4c6e20ecf9579eb2508b1e 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-        {* this function is called to change the color of selected row(s) *}
-        var fname = "{$form.formName}";
-        on_load_init_checkboxes(fname);
-        </script>
-
         {include file="CRM/common/pager.tpl" location="bottom"}
 
         </p>
@@ -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;
 }
index 79fb5b9b49a54032bb30e322fb35639a3cb81e99..2cfe61f788a8627a0c6cae6d9b96d0f7470953f4 100644 (file)
     </table>
     {/strip}
 
-<script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-
 {include file="CRM/common/pager.tpl" location="bottom"}
 
 
index 6ac064d461b49a4660e90f6b3975e452f11f7467..747f9354ecc1195e1b5138f3d8391751e84b92de 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-        {* this function is called to change the color of selected row(s) *}
-           var fname = "{$form.formName}";
-           on_load_init_checkboxes(fname);
-        </script>
-
         {include file="CRM/common/pager.tpl" location="bottom"}
 
         </p>
index be5849448e6f5849981abdb04886bebea2f36353..20d62122d61bb2fade5e878f0b5f0426f19b6b3f 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-        {* this function is called to change the color of selected row(s) *}
-        var fname = "{$form.formName}";
-        on_load_init_checkboxes(fname);
-        </script>
 
         {include file="CRM/common/pager.tpl" location="bottom"}
 
index 919febd07933dd5329f215faa7a4148c67455c07..44ad7d79119ea2885fadd0ef32e00f935d843c59 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-            {* this function is called to change the color of selected row(s) *}
-            on_load_init_checkboxes("{$form.formName}");
-        </script>
-
         {include file="CRM/common/pager.tpl" location="bottom"}
 
         </p>
index 86fa96aeef9194606e5fa290b4639c693f510162..c550d089b54df649e3b786aad1f01db1bfcb722c 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-            {* this function is called to change the color of selected row(s) *}
-            var fname = "{$form.formName}";
-            on_load_init_checkboxes(fname);
-        </script>
-
         {include file="CRM/common/pager.tpl" location="bottom"}
 
         </p>
index a49b22d6b48f6316d8b1742599d6315b42bf59f5..089d3fb909381f45339f0bfd1eb8552e7e2562fb 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-        {* this function is called to change the color of selected row(s) *}
-        var fname = "{$form.formName}";
-        on_load_init_checkboxes(fname);
-        </script>
 
         {include file="CRM/common/pager.tpl" location="bottom"}
 
index 61cec069e95576daf2f8a4d0edcdb1d7fbd4838f..880ed11c537a107ec422acc43a64bdd29d3549ab 100644 (file)
@@ -94,6 +94,8 @@
 
 {literal}
 <script type="text/javascript">
-toggleTaskAction( );
+cj(function() {
+  toggleTaskAction( );
+});
 </script>
 {/literal}
index c218769f9c38acb39ad9c786c57224129b820dc3..ba2a5acee939099ef683b49e45f250f28ea8b37a 100644 (file)
     }
     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');
index cf9dde368db711ced3ecb00147d5c6dce9cf999e..6074f84d5d15c0b837f16e2933f0201654b22848 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
+
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index c22727f2c70be24fb568e57e646dd5e328875743..681a55fefa6db44f3c82c2f6a624808fa756950c 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
+
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index d765234721a5552e8de2e2b7500d5af1145d2902..d542ec8c1799ab9d5fa2368e1fa883216dcd7f04 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
+
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index 824e64c4e0f3ec0e5a85114920c46ae6e08edecc..fb490b48c2dae0552ab2e6353a649c5cd4f0120c 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
+
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index 4926ea5b4a9981d545ce8264f61724d9273660ba..74c3a53911b4707aedbb6ac9ad2cff8653d7208c 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
- <script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
+
 
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
index 39b5372be145e621b71114fcb1145f08c207a817..1c787b1beeed8a1ce48b97c3ad8467d276bb51b7 100644 (file)
 </table>
 {/strip}
 
-{if $context EQ 'Search'}
-    <script type="text/javascript">
-    {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";
-    on_load_init_checkboxes(fname);
- </script>
-{/if}
-
 {if $context EQ 'Search'}
     {include file="CRM/common/pager.tpl" location="bottom"}
 {/if}
index f217c9c5719d7ccbe5c6bb1ea8f71fa0a1bb96ec..83e39c41266d8f012899a76f03750f0e9a4b02c4 100644 (file)
@@ -78,8 +78,8 @@
 </div>
 {literal}
 <script type="text/javascript">
-toggleTaskAction( );
 cj(function() {
+  toggleTaskAction( );
   if (cj('#task option').length == 1 && !cj('#task option').val()) {
     cj('#task-section').remove();
   }
index 6982aab2621d5234388448ccb7e7eb8da620feb1..b7890d655a4af1a293a4d87b4d9af066196519b4 100644 (file)
     </table>
     {/strip}
 
-<script type="text/javascript">
- {* this function is called to change the color of selected row(s) *}
-    var fname = "{$form.formName}";    
-    on_load_init_checkboxes(fname);
- </script>
-
 {include file="CRM/common/pager.tpl" location="bottom"}
 
 
index 980454dcc6231e8f8ffbf29b298487f0e191643f..fbdc38069c078cf7e789c58b3e0b007d112ff7ea 100644 (file)
         </table>
         {/strip}
 
-        <script type="text/javascript">
-            {* this function is called to change the color of selected row(s) *}
-            var fname = "{$form.formName}";    
-            on_load_init_checkboxes(fname);
-        </script>
-
         {include file="CRM/common/pager.tpl" location="bottom"}
 
         </p>