+++ /dev/null
-<?php
-/*
- +--------------------------------------------------------------------+
- | 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 |
- +--------------------------------------------------------------------+
- */
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
- */
-
-/**
- * Page for displaying Campaigns
- */
-class CRM_Campaign_Page_Campaign extends CRM_Core_Page {
-
- public $useLivePageJS = TRUE;
-
- /**
- * The action links that we need to display for the browse screen.
- *
- * @var array
- */
- private static $_actionLinks;
-
- /**
- * Get the action links for this page.
- *
- * @return array
- */
- public function &actionLinks() {
- // check if variable _actionsLinks is populated
- if (!isset(self::$_actionLinks)) {
- $deleteExtra = ts('Are you sure you want to delete this Campaign?');
- self::$_actionLinks = array(
- CRM_Core_Action::UPDATE => 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();
- }
-
-}
+++ /dev/null
-<?php
-/*
- +--------------------------------------------------------------------+
- | 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 |
- +--------------------------------------------------------------------+
- */
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
- */
-
-/**
- * Page for displaying Surveys
- */
-class CRM_Campaign_Page_Survey extends CRM_Core_Page {
-
- public $useLivePageJS = TRUE;
-
- private static $_actionLinks;
-
- /**
- * @return array
- */
- public function &actionLinks() {
- // check if variable _actionsLinks is populated
- if (!isset(self::$_actionLinks)) {
-
- self::$_actionLinks = array(
- CRM_Core_Action::UPDATE => 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();
- }
-
-}
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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}
- <div class="action-link">
- <a href="{$addCampaignUrl}" class="button">
- <span><div class="icon ui-icon-circle-plus"></div> {ts}Add Campaign{/ts}</span>
- </a>
- </div>
- {include file="CRM/common/enableDisableApi.tpl"}
- <div id="campaignType">
- <table id="options" class="display">
- <thead>
- <tr>
- <th>{ts}Campaign Title{/ts}</th>
- <th>{ts}Description{/ts}</th>
- <th>{ts}Start Date{/ts}</th>
- <th>{ts}End Date{/ts}</th>
- <th>{ts}Campaign Type{/ts}</th>
- <th>{ts}Status{/ts}</th>
- <th>{ts}Active?{/ts}</th>
- <th id="nosort"></th>
- </tr>
- </thead>
- {foreach from=$campaigns item=campaign}
- <tr id="campaign-{$campaign.campaign_id}" class="crm-entity {if $campaign.is_active neq 1} disabled{/if}">
- <td class="crm-editable" data-field="title">{$campaign.title}</td>
- <td>{$campaign.description}</td>
- <td>{$campaign.start_date}</td>
- <td>{$campaign.end_date}</td>
- <td>{$campaign.campaign_type_id}</td>
- <td>{$campaign.status_id}</td>
- <td id="row_{$campaign.id}_status">{if $campaign.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
- <td>{$campaign.action}</td>
- </tr>
- {/foreach}
- </table>
- </div>
-
-{else}
- <div class="messages status no-popup">
- <div class="icon inform-icon"></div>
- {ts}None found.{/ts}
- </div>
-{/if}
-<div class="action-link">
- <a href="{$addCampaignUrl}" class="button">
- <span><div class="icon ui-icon-circle-plus"></div> {ts}Add Campaign{/ts}</span>
- </a>
-</div>
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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}
- <div class="action-link">
- <a href="{$addSurveyUrl}" class="button">
- <span><div class="icon ui-icon-circle-plus"></div> {ts}Add Survey{/ts}</span>
- </a>
- </div>
- {include file="CRM/common/enableDisableApi.tpl"}
- {include file="CRM/common/jsortable.tpl"}
- <div id="surveyList">
- <table id="options" class="display">
- <thead>
- <tr>
- <th>{ts}Survey{/ts}</th>
- <th>{ts}Campaign{/ts}</th>
- <th>{ts}Survey Type{/ts}</th>
- <th>{ts}Release Frequency{/ts}</th>
- <th>{ts}Max Number Of Contacts{/ts}</th>
- <th>{ts}Default Number Of Contacts{/ts}</th>
- <th>{ts}Default?{/ts}</th>
- <th>{ts}Active?{/ts}</th>
- <th id="nosort"></th>
- </tr>
- </thead>
- {foreach from=$surveys item=survey}
- <tr id="survey-{$survey.id}" class="crm-entity {if $survey.is_active neq 1} disabled{/if}">
- <td>{$survey.title}</td>
- <td>{$survey.campaign_id}</td>
- <td>{$survey.activity_type_id}</td>
- <td>{$survey.release_frequency}</td>
- <td>{$survey.max_number_of_contacts}</td>
- <td>{$survey.default_number_of_contacts}</td>
- <td>{if $survey.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" /> {/if}</td>
- <td id="row_{$survey.id}_status">{if $survey.is_active}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td>
- <td class="crm-report-optionList-action">{$survey.action}</td>
- </tr>
- {/foreach}
- </table>
- </div>
-
-{else}
- <div class="status">
- <div class="icon inform-icon"></div> {ts}None found.{/ts}
- </div>
-{/if}
-<div class="action-link">
- <a href="{$addSurveyUrl}" class="button">
- <span><div class="icon ui-icon-circle-plus"></div> {ts}Add Survey{/ts}</span>
- </a>
-</div>