From e18f3eb69d815babb86a1a2138db249b8a8349df Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 5 Jun 2015 22:35:08 -0400 Subject: [PATCH] Delete unused campaign/survey files --- CRM/Campaign/Page/Campaign.php | 143 ----------------------- CRM/Campaign/Page/Survey.php | 136 --------------------- templates/CRM/Campaign/Page/Campaign.tpl | 73 ------------ templates/CRM/Campaign/Page/Survey.tpl | 76 ------------ 4 files changed, 428 deletions(-) delete mode 100644 CRM/Campaign/Page/Campaign.php delete mode 100644 CRM/Campaign/Page/Survey.php delete mode 100644 templates/CRM/Campaign/Page/Campaign.tpl delete mode 100644 templates/CRM/Campaign/Page/Survey.tpl diff --git a/CRM/Campaign/Page/Campaign.php b/CRM/Campaign/Page/Campaign.php deleted file mode 100644 index ff6dcb84b6..0000000000 --- a/CRM/Campaign/Page/Campaign.php +++ /dev/null @@ -1,143 +0,0 @@ - array( - 'name' => ts('Edit'), - 'url' => 'civicrm/campaign/add', - 'qs' => 'reset=1&action=update&id=%%id%%', - 'title' => ts('Update Campaign'), - ), - CRM_Core_Action::DISABLE => array( - 'name' => ts('Disable'), - 'title' => ts('Disable Campaign'), - 'ref' => 'crm-enable-disable', - ), - CRM_Core_Action::ENABLE => array( - 'name' => ts('Enable'), - 'title' => ts('Enable Campaign'), - 'ref' => 'crm-enable-disable', - ), - CRM_Core_Action::DELETE => array( - 'name' => ts('Delete'), - 'url' => 'civicrm/campaign/add', - 'qs' => 'action=delete&reset=1&id=%%id%%', - 'title' => ts('Delete Campaign'), - ), - ); - } - return self::$_actionLinks; - } - - public function browse() { - - $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary(); - - if (!empty($campaigns)) { - $campaignType = CRM_Core_PseudoConstant::campaignType(); - $campaignStatus = CRM_Core_PseudoConstant::campaignStatus(); - - foreach ($campaigns as $cmpid => $campaign) { - - $campaigns[$cmpid]['campaign_id'] = $campaign['id']; - $campaigns[$cmpid]['title'] = $campaign['title']; - $campaigns[$cmpid]['name'] = $campaign['name']; - $campaigns[$cmpid]['description'] = $campaign['description']; - $campaigns[$cmpid]['campaign_type_id'] = $campaignType[$campaign['campaign_type_id']]; - $campaigns[$cmpid]['status_id'] = $campaignStatus[$campaign['status_id']]; - - $action = array_sum(array_keys($this->actionLinks())); - if ($campaign['is_active']) { - $action -= CRM_Core_Action::ENABLE; - } - else { - $action -= CRM_Core_Action::DISABLE; - } - $campaigns[$cmpid]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, - array('id' => $campaign['id']), - ts('more'), - FALSE, - 'campaign.selector.row', - 'Campaign', - $campaign['id'] - ); - } - } - - $this->assign('campaigns', $campaigns); - $this->assign('addCampaignUrl', CRM_Utils_System::url('civicrm/campaign/add', 'reset=1&action=add')); - } - - /** - * @return string - */ - public function run() { - if (!CRM_Core_Permission::check('administer CiviCampaign')) { - CRM_Utils_System::permissionDenied(); - } - - $action = CRM_Utils_Request::retrieve('action', 'String', - $this, FALSE, 0 - ); - $this->assign('action', $action); - $this->browse(); - - return parent::run(); - } - -} diff --git a/CRM/Campaign/Page/Survey.php b/CRM/Campaign/Page/Survey.php deleted file mode 100644 index 5cbecbcab3..0000000000 --- a/CRM/Campaign/Page/Survey.php +++ /dev/null @@ -1,136 +0,0 @@ - array( - 'name' => ts('Edit'), - 'url' => 'civicrm/survey/add', - 'qs' => 'action=update&id=%%id%%&reset=1', - 'title' => ts('Update Survey'), - ), - CRM_Core_Action::DISABLE => array( - 'name' => ts('Disable'), - 'ref' => 'crm-enable-disable', - 'title' => ts('Disable Survey'), - ), - CRM_Core_Action::ENABLE => array( - 'name' => ts('Enable'), - 'ref' => 'crm-enable-disable', - 'title' => ts('Enable Survey'), - ), - CRM_Core_Action::DELETE => array( - 'name' => ts('Delete'), - 'url' => 'civicrm/survey/delete', - 'qs' => 'id=%%id%%&reset=1', - 'title' => ts('Delete Survey'), - ), - ); - } - return self::$_actionLinks; - } - - public function browse() { - - $surveys = CRM_Campaign_BAO_Survey::getSurveySummary(); - - if (!empty($surveys)) { - - $surveyType = CRM_Campaign_BAO_Survey::getSurveyActivityType(); - $campaigns = CRM_Campaign_BAO_Campaign::getAllCampaign(); - $activityTypes = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, FALSE, 'name'); - foreach ($surveys as $sid => $survey) { - $surveys[$sid]['campaign_id'] = $campaigns[$survey['campaign_id']]; - $surveys[$sid]['activity_type_id'] = $surveyType[$survey['activity_type_id']]; - $surveys[$sid]['release_frequency'] = $survey['release_frequency_interval'] . ' ' . $survey['release_frequency_unit']; - - $action = array_sum(array_keys($this->actionLinks())); - if ($survey['is_active']) { - $action -= CRM_Core_Action::ENABLE; - } - else { - $action -= CRM_Core_Action::DISABLE; - } - - $surveys[$sid]['action'] = CRM_Core_Action::formLink( - $this->actionLinks(), - $action, - array('id' => $sid), - ts('more'), - FALSE, - 'survey.selector.row', - 'Survey', - $sid - ); - } - } - - $this->assign('surveys', $surveys); - $this->assign('addSurveyUrl', CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add')); - } - - /** - * @return string - */ - public function run() { - if (!CRM_Campaign_BAO_Campaign::accessCampaign()) { - CRM_Utils_System::permissionDenied(); - } - - $action = CRM_Utils_Request::retrieve('action', 'String', - $this, FALSE, 0 - ); - $this->assign('action', $action); - $this->browse(); - - return parent::run(); - } - -} diff --git a/templates/CRM/Campaign/Page/Campaign.tpl b/templates/CRM/Campaign/Page/Campaign.tpl deleted file mode 100644 index 918f59dc09..0000000000 --- a/templates/CRM/Campaign/Page/Campaign.tpl +++ /dev/null @@ -1,73 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.6 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | - +--------------------------------------------------------------------+ - | 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 | - +--------------------------------------------------------------------+ -*} -{* this template is used for displaying survey information *} -{if $campaigns} - - {include file="CRM/common/enableDisableApi.tpl"} -
- - - - - - - - - - - - - - {foreach from=$campaigns item=campaign} - - - - - - - - - - - {/foreach} -
{ts}Campaign Title{/ts}{ts}Description{/ts}{ts}Start Date{/ts}{ts}End Date{/ts}{ts}Campaign Type{/ts}{ts}Status{/ts}{ts}Active?{/ts}
{$campaign.title}{$campaign.description}{$campaign.start_date}{$campaign.end_date}{$campaign.campaign_type_id}{$campaign.status_id}{if $campaign.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}{$campaign.action}
-
- -{else} -
-
  - {ts}None found.{/ts} -
-{/if} - diff --git a/templates/CRM/Campaign/Page/Survey.tpl b/templates/CRM/Campaign/Page/Survey.tpl deleted file mode 100644 index 05a61d2e1c..0000000000 --- a/templates/CRM/Campaign/Page/Survey.tpl +++ /dev/null @@ -1,76 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.6 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | - +--------------------------------------------------------------------+ - | 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 | - +--------------------------------------------------------------------+ -*} -{* this template is used for displaying survey information *} - -{if $surveys} - - {include file="CRM/common/enableDisableApi.tpl"} - {include file="CRM/common/jsortable.tpl"} -
- - - - - - - - - - - - - - - {foreach from=$surveys item=survey} - - - - - - - - - - - - {/foreach} -
{ts}Survey{/ts}{ts}Campaign{/ts}{ts}Survey Type{/ts}{ts}Release Frequency{/ts}{ts}Max Number Of Contacts{/ts}{ts}Default Number Of Contacts{/ts}{ts}Default?{/ts}{ts}Active?{/ts}
{$survey.title}{$survey.campaign_id}{$survey.activity_type_id}{$survey.release_frequency}{$survey.max_number_of_contacts}{$survey.default_number_of_contacts}{if $survey.is_default}{ts}Default{/ts} {/if}{if $survey.is_active}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}{$survey.action}
-
- -{else} -
-
 {ts}None found.{/ts} -
-{/if} - -- 2.25.1