codespell: CRM/*
[civicrm-core.git] / CRM / Campaign / Form / Task / Release.php
index 770aaca72170541995ecfc192e0f8d6b743b633f..ec668bdb1649a70534fc4a08b9b9c0b0bf4d5b5e 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$
  *
  */
@@ -63,7 +63,7 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task {
   protected $_surveyActivities;
 
   /**
-   * Build all the data structures needed to build the form
+   * Build all the data structures needed to build the form.
    *
    * @return void
    */
@@ -136,7 +136,7 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    *
    * @return void
@@ -154,18 +154,28 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task {
       }
     }
 
-    //set survey activites as deleted = true.
+    //set survey activities as deleted = true.
     if (!empty($deleteActivityIds)) {
       $query = 'UPDATE civicrm_activity SET is_deleted = 1 WHERE id IN ( ' . implode(', ', $deleteActivityIds) . ' )';
       CRM_Core_DAO::executeQuery($query);
 
-      $status = array(ts("%1 respondent(s) have been released.", array(1 => count($deleteActivityIds))));
+      if ($deleteActivityIds) {
+        $status = ts("Respondent has been released.", array(
+          'count' => count($deleteActivityIds),
+          'plural' => '%count respondents have been released.',
+        ));
+        CRM_Core_Session::setStatus($status, ts('Released'), 'success');
+      }
+
       if (count($this->_contactIds) > count($deleteActivityIds)) {
-        $status[] = ts("%1 respondents did not release.",
-          array(1 => (count($this->_contactIds) - count($deleteActivityIds)))
+        $status = ts('1 respondent did not release.',
+          array(
+            'count' => (count($this->_contactIds) - count($deleteActivityIds)),
+            'plural' => '%count respondents did not release.',
+          )
         );
+        CRM_Core_Session::setStatus($status, ts('Notice'), 'alert');
       }
-      CRM_Core_Session::setStatus(implode(' ', $status), '', 'info');
     }
   }