First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
130
sites/all/modules/civicrm/CRM/Campaign/Form/Search/Campaign.php
Normal file
130
sites/all/modules/civicrm/CRM/Campaign/Form/Search/Campaign.php
Normal file
|
@ -0,0 +1,130 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| 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 and the CiviCRM Licensing Exception 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*/
|
||||
|
||||
/**
|
||||
* Files required.
|
||||
*/
|
||||
class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form {
|
||||
|
||||
/**
|
||||
* Are we forced to run a search.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_force;
|
||||
|
||||
/**
|
||||
* Processing needed for buildForm and later.
|
||||
*/
|
||||
public function preProcess() {
|
||||
$this->_search = CRM_Utils_Array::value('search', $_GET);
|
||||
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
|
||||
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'campaign');
|
||||
|
||||
//when we do load tab, lets load the default objects.
|
||||
$this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
|
||||
$this->assign('searchParams', json_encode($this->get('searchParams')));
|
||||
$this->assign('buildSelector', $this->_search);
|
||||
$this->assign('searchFor', $this->_searchTab);
|
||||
$this->assign('campaignTypes', json_encode($this->get('campaignTypes')));
|
||||
$this->assign('campaignStatus', json_encode($this->get('campaignStatus')));
|
||||
$this->assign('suppressForm', TRUE);
|
||||
|
||||
//set the form title.
|
||||
CRM_Utils_System::setTitle(ts('Find Campaigns'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the form object.
|
||||
*/
|
||||
public function buildQuickForm() {
|
||||
if ($this->_search) {
|
||||
return;
|
||||
}
|
||||
|
||||
$attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign');
|
||||
$this->add('text', 'campaign_title', ts('Title'), $attributes['title']);
|
||||
|
||||
//campaign description.
|
||||
$this->add('text', 'description', ts('Description'), $attributes['description']);
|
||||
|
||||
//campaign start date.
|
||||
$this->addDate('start_date', ts('From'), FALSE, array('formatType' => 'searchDate'));
|
||||
|
||||
//campaign end date.
|
||||
$this->addDate('end_date', ts('To'), FALSE, array('formatType' => 'searchDate'));
|
||||
|
||||
//campaign type.
|
||||
$campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
|
||||
$this->add('select', 'campaign_type_id', ts('Campaign Type'),
|
||||
array(
|
||||
'' => ts('- select -'),
|
||||
) + $campaignTypes
|
||||
);
|
||||
|
||||
$this->set('campaignTypes', $campaignTypes);
|
||||
$this->assign('campaignTypes', json_encode($campaignTypes));
|
||||
|
||||
//campaign status
|
||||
$campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
|
||||
$this->addElement('select', 'status_id', ts('Campaign Status'),
|
||||
array(
|
||||
'' => ts('- select -'),
|
||||
) + $campaignStatus
|
||||
);
|
||||
$this->set('campaignStatus', $campaignStatus);
|
||||
$this->assign('campaignStatus', json_encode($campaignStatus));
|
||||
|
||||
//active campaigns
|
||||
$this->addElement('select', 'is_active', ts('Is Active?'), array(
|
||||
'' => ts('- select -'),
|
||||
'0' => ts('Yes'),
|
||||
'1' => ts('No'),
|
||||
)
|
||||
);
|
||||
|
||||
//build the array of all search params.
|
||||
$this->_searchParams = array();
|
||||
foreach ($this->_elements as $element) {
|
||||
$name = $element->_attributes['name'];
|
||||
$label = $element->_label;
|
||||
if ($name == 'qfKey') {
|
||||
continue;
|
||||
}
|
||||
$this->_searchParams[$name] = ($label) ? $label : $name;
|
||||
}
|
||||
$this->set('searchParams', $this->_searchParams);
|
||||
$this->assign('searchParams', json_encode($this->_searchParams));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| 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 and the CiviCRM Licensing Exception 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*/
|
||||
|
||||
/**
|
||||
* Files required.
|
||||
*/
|
||||
class CRM_Campaign_Form_Search_Petition extends CRM_Core_Form {
|
||||
|
||||
/**
|
||||
* Are we forced to run a search.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_force;
|
||||
|
||||
/**
|
||||
* Processing needed for buildForm and later.
|
||||
*/
|
||||
public function preProcess() {
|
||||
$this->_search = CRM_Utils_Array::value('search', $_GET);
|
||||
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
|
||||
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'petition');
|
||||
|
||||
//when we do load tab, lets load the default objects.
|
||||
$this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
|
||||
$this->assign('searchParams', json_encode($this->get('searchParams')));
|
||||
$this->assign('buildSelector', $this->_search);
|
||||
$this->assign('searchFor', $this->_searchTab);
|
||||
$this->assign('petitionCampaigns', json_encode($this->get('petitionCampaigns')));
|
||||
$this->assign('suppressForm', TRUE);
|
||||
|
||||
//set the form title.
|
||||
CRM_Utils_System::setTitle(ts('Find Petition'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the form object.
|
||||
*/
|
||||
public function buildQuickForm() {
|
||||
if ($this->_search) {
|
||||
return;
|
||||
}
|
||||
|
||||
$attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey');
|
||||
$this->add('text', 'petition_title', ts('Title'), $attributes['title']);
|
||||
|
||||
//campaigns
|
||||
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
|
||||
$this->add('select', 'petition_campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns);
|
||||
$this->set('petitionCampaigns', $campaigns);
|
||||
$this->assign('petitionCampaigns', json_encode($campaigns));
|
||||
|
||||
//build the array of all search params.
|
||||
$this->_searchParams = array();
|
||||
foreach ($this->_elements as $element) {
|
||||
$name = $element->_attributes['name'];
|
||||
$label = $element->_label;
|
||||
if ($name == 'qfKey') {
|
||||
continue;
|
||||
}
|
||||
$this->_searchParams[$name] = ($label) ? $label : $name;
|
||||
}
|
||||
$this->set('searchParams', $this->_searchParams);
|
||||
$this->assign('searchParams', json_encode($this->_searchParams));
|
||||
}
|
||||
|
||||
}
|
108
sites/all/modules/civicrm/CRM/Campaign/Form/Search/Survey.php
Normal file
108
sites/all/modules/civicrm/CRM/Campaign/Form/Search/Survey.php
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| 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 and the CiviCRM Licensing Exception 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*/
|
||||
|
||||
/**
|
||||
* Files required.
|
||||
*/
|
||||
class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form {
|
||||
|
||||
/**
|
||||
* Are we forced to run a search.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_force;
|
||||
|
||||
/**
|
||||
* Processing needed for buildForm and later.
|
||||
*/
|
||||
public function preProcess() {
|
||||
$this->_search = CRM_Utils_Array::value('search', $_GET);
|
||||
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
|
||||
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'survey');
|
||||
|
||||
//when we do load tab, lets load the default objects.
|
||||
$this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
|
||||
$this->assign('searchParams', json_encode($this->get('searchParams')));
|
||||
$this->assign('buildSelector', $this->_search);
|
||||
$this->assign('searchFor', $this->_searchTab);
|
||||
$this->assign('surveyTypes', json_encode($this->get('surveyTypes')));
|
||||
$this->assign('surveyCampaigns', json_encode($this->get('surveyCampaigns')));
|
||||
$this->assign('suppressForm', TRUE);
|
||||
|
||||
//set the form title.
|
||||
CRM_Utils_System::setTitle(ts('Find Survey'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the form object.
|
||||
*/
|
||||
public function buildQuickForm() {
|
||||
if ($this->_search) {
|
||||
return;
|
||||
}
|
||||
|
||||
$attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey');
|
||||
$this->add('text', 'survey_title', ts('Title'), $attributes['title']);
|
||||
|
||||
//activity Type id
|
||||
$surveyTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
|
||||
$this->add('select', 'activity_type_id',
|
||||
ts('Activity Type'), array(
|
||||
'' => ts('- select -'),
|
||||
) + $surveyTypes
|
||||
);
|
||||
$this->set('surveyTypes', $surveyTypes);
|
||||
$this->assign('surveyTypes', json_encode($surveyTypes));
|
||||
|
||||
//campaigns
|
||||
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
|
||||
$this->add('select', 'survey_campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns);
|
||||
$this->set('surveyCampaigns', $campaigns);
|
||||
$this->assign('surveyCampaigns', json_encode($campaigns));
|
||||
|
||||
//build the array of all search params.
|
||||
$this->_searchParams = array();
|
||||
foreach ($this->_elements as $element) {
|
||||
$name = $element->_attributes['name'];
|
||||
$label = $element->_label;
|
||||
if ($name == 'qfKey') {
|
||||
continue;
|
||||
}
|
||||
$this->_searchParams[$name] = ($label) ? $label : $name;
|
||||
}
|
||||
$this->set('searchParams', $this->_searchParams);
|
||||
$this->assign('searchParams', json_encode($this->_searchParams));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue