X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FCampaign%2FForm%2FTask%2FRelease.php;h=ec668bdb1649a70534fc4a08b9b9c0b0bf4d5b5e;hb=b44e3f8468ceba3e1b321d31dd2e35a1aa1a5d9a;hp=cb408656a6b807793893f3b7df3d8a7b16c494c5;hpb=87878ac8e6101fc5bed04f356c677b5f9ec54bc7;p=civicrm-core.git diff --git a/CRM/Campaign/Form/Task/Release.php b/CRM/Campaign/Form/Task/Release.php index cb408656a6..ec668bdb16 100644 --- a/CRM/Campaign/Form/Task/Release.php +++ b/CRM/Campaign/Form/Task/Release.php @@ -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. | | | @@ -23,12 +23,12 @@ | 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-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,29 @@ 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'); } } + }