X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCase%2FForm%2FTask%2FDelete.php;h=ef6fbf7dc416b96b7a8889d5d1b7aaf2ced3c51d;hb=fee14197b427c1781e369e5bfd36816afad6d7ee;hp=0579065f9007b74175380ff4ca85f2eee0188998;hpb=e7ed2ed6dfa73a6225b7d2a2d09529edec03f974;p=civicrm-core.git diff --git a/CRM/Case/Form/Task/Delete.php b/CRM/Case/Form/Task/Delete.php index 0579065f90..ef6fbf7dc4 100644 --- a/CRM/Case/Form/Task/Delete.php +++ b/CRM/Case/Form/Task/Delete.php @@ -1,9 +1,9 @@ addDefaultButtons(ts('Delete Cases'), 'done'); + $this->addDefaultButtons(ts('Delete cases'), 'done'); } /** * Process the form after the input has been submitted and validated. - * - * @return void */ public function postProcess() { - $deletedCases = 0; + $deleted = $failed = 0; foreach ($this->_caseIds as $caseId) { if (CRM_Case_BAO_Case::deleteCase($caseId, $this->_moveToTrash)) { - $deletedCases++; + $deleted++; + } + else { + $failed++; } } - CRM_Core_Session::setStatus($deletedCases, ts('Deleted Cases'), 'success'); - CRM_Core_Session::setStatus('', ts('Total Selected Case(s): %1', array(1 => count($this->_caseIds))), 'info'); + if ($deleted) { + if ($this->_moveToTrash) { + $msg = ts('%count case moved to trash.', array('plural' => '%count cases moved to trash.', 'count' => $deleted)); + } + else { + $msg = ts('%count case permanently deleted.', array('plural' => '%count cases permanently deleted.', 'count' => $deleted)); + } + CRM_Core_Session::setStatus($msg, ts('Removed'), 'success'); + } + + if ($failed) { + CRM_Core_Session::setStatus(ts('1 could not be deleted.', array('plural' => '%count could not be deleted.', 'count' => $failed)), ts('Error'), 'error'); + } } }