/**
* This file is for activity search
*/
-class CRM_Activity_Form_Search extends CRM_Core_Form {
+class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text', 'sort_name', ts('Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Activity_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL,
array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows')
);
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**
/**
* Files required
*/
-class CRM_Campaign_Form_Search extends CRM_Core_Form {
+class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
//build the search form.
CRM_Campaign_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- )
- );
}
/**
/**
* This file is for Case search
*/
-class CRM_Case_Form_Search extends CRM_Core_Form {
+class CRM_Case_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text',
'sort_name',
ts('Client Name or Email'),
*/
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox',
'toggleSelect',
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**
* Base Search / View form for *all* listing of multiple
* contacts
*/
-class CRM_Contact_Form_Search extends CRM_Core_Form {
+class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
/*
* list of valid contexts
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
CRM_Core_Resources::singleton()
- ->addScriptFile('civicrm', 'js/crm.livePage.js')
- ->addScriptFile('civicrm', 'js/crm.searchForm.js')
// jsTree is needed for tags popup
->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)
->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header');
$this->assign_by_ref('unselectedContactIds', $unselectedContactIds);
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- )
- );
-
- $this->setDefaultAction('refresh');
}
/**
/**
* advanced search, extends basic search
*/
-class CRM_Contribute_Form_Search extends CRM_Core_Form {
+class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
// text for sort_name
$this->addElement('text',
'sort_name',
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox',
'toggleSelect',
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- )
- );
}
/**
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License along with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*/
+
+/**
+ * Base class for most search forms
+ */
+class CRM_Core_Form_Search extends CRM_Core_Form {
+
+ function buildQuickform() {
+ $resources = CRM_Core_Resources::singleton();
+
+ if ($resources->ajaxPopupsEnabled) {
+ $resources->addScriptFile('civicrm', 'js/crm.livePage.js');
+ // Script needed by some popups
+ $this->assign('includeWysiwygEditor', TRUE);
+ }
+
+ $resources->addScriptFile('civicrm', 'js/crm.searchForm.js');
+
+ $this->addButtons(array(
+ array(
+ 'type' => 'refresh',
+ 'name' => ts('Search'),
+ 'isDefault' => TRUE,
+ ),
+ ));
+ }
+}
/**
* This file is for civievent search
*/
-class CRM_Event_Form_Search extends CRM_Core_Form {
+class CRM_Event_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text', 'sort_name', ts('Participant Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Event_BAO_Query::buildSearchForm($this);
*/
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
$lineItems = $eventIds = array();
if (!$this->_single) {
$this->addElement('checkbox',
);
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**
/**
* This file is for civigrant search
*/
-class CRM_Grant_Form_Search extends CRM_Core_Form {
+class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text', 'sort_name', ts('Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Grant_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onchange' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onchange' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**
/**
* This file is for civimember search
*/
-class CRM_Member_Form_Search extends CRM_Core_Form {
+class CRM_Member_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text', 'sort_name', ts('Member Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Member_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
-
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**
/**
* This file is for Pledge search
*/
-class CRM_Pledge_Form_Search extends CRM_Core_Form {
+class CRM_Pledge_Form_Search extends CRM_Core_Form_Search {
/**
* Are we forced to run a search
* @return void
*/
function buildQuickForm() {
+ parent::buildQuickForm();
$this->addElement('text', 'sort_name', ts('Pledger Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Pledge_BAO_Query::buildSearchForm($this);
*/
$rows = $this->get('rows');
if (is_array($rows)) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js');
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
- // add buttons
- $this->addButtons(array(
- array(
- 'type' => 'refresh',
- 'name' => ts('Search'),
- 'isDefault' => TRUE,
- ),
- ));
}
/**