Merge pull request #5252 from JKingsnorth/CRM-10551
[civicrm-core.git] / CRM / Campaign / Page / DashBoard.php
index 598906e62838dfe88ee4d0fa375e44e4754135ad..595e09b751fbfb4eefb4de54aea8476e18814845 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  --------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -39,7 +39,7 @@
 class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
 
   /**
-   * The action links that we need to display for the browse screen
+   * The action links that we need to display for the browse screen.
    *
    * @var array
    */
@@ -52,10 +52,9 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
    *
    * @return array
    */
-  public function &campaignActionLinks() {
+  public static function campaignActionLinks() {
     // check if variable _actionsLinks is populated
     if (!isset(self::$_campaignActionLinks)) {
-      $deleteExtra = ts('Are you sure you want to delete this Campaign?');
       self::$_campaignActionLinks = array(
         CRM_Core_Action::UPDATE => array(
           'name' => ts('Edit'),
@@ -88,7 +87,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
   /**
    * @return array
    */
-  public function &surveyActionLinks() {
+  public static function surveyActionLinks() {
     // check if variable _actionsLinks is populated
     if (!isset(self::$_surveyActionLinks)) {
       self::$_surveyActionLinks = array(
@@ -123,7 +122,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
   /**
    * @return array
    */
-  public function &petitionActionLinks() {
+  public static function petitionActionLinks() {
     if (!isset(self::$_petitionActionLinks)) {
       self::$_petitionActionLinks = self::surveyActionLinks();
       self::$_petitionActionLinks[CRM_Core_Action::UPDATE] = array(
@@ -299,7 +298,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
    *
    * @return array
    */
-  public function getSurveySummary($params = array()) {
+  public static function getSurveySummary($params = array()) {
     $surveysData = array();
 
     //get the survey.
@@ -314,7 +313,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
         $surveysData[$sid]['campaign'] = CRM_Utils_Array::value($campaignId, $campaigns);
         $surveysData[$sid]['activity_type'] = $surveyType[$survey['activity_type_id']];
         if (!empty($survey['release_frequency'])) {
-          $surveysData[$sid]['release_frequency'] = $survey['release_frequency'] . ' Day(s)';
+          $surveysData[$sid]['release_frequency'] = ts('1 Day', array('plural' => '%count Days', 'count' => $survey['release_frequency']));
         }
 
         $action = array_sum(array_keys(self::surveyActionLinks($surveysData[$sid]['activity_type'])));
@@ -378,7 +377,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
    * @return mixed|null
    */
   public function browsePetition() {
-    // ensure valid javascript - this must have a value set
+    // Ensure valid javascript - this must have a value set
     $this->assign('searchParams', json_encode(NULL));
     $this->assign('petitionCampaigns', json_encode(NULL));
 
@@ -388,11 +387,11 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
     //don't load find interface when no petition in db.
     if (!$petitionCount) {
       $this->assign('hasPetitions', FALSE);
-      return;
+      return NULL;
     }
     $this->assign('hasPetitions', TRUE);
 
-    //build the ajaxify petition search and selector.
+    // Build the ajax petition search and selector.
     $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Search_Petition', ts('Search Petition'));
     $controller->set('searchTab', 'petition');
     $controller->setEmbedded(TRUE);
@@ -405,7 +404,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
    *
    * @return array
    */
-  public function getPetitionSummary($params = array()) {
+  public static function getPetitionSummary($params = array()) {
     $config = CRM_Core_Config::singleton();
     $petitionsData = array();