addDefaultButtons(ts('Delete Cases'), 'done'); } /** * Process the form after the input has been submitted and validated. * * @return void */ public function postProcess() { $deleted = $failed = 0; foreach ($this->_caseIds as $caseId) { if (CRM_Case_BAO_Case::deleteCase($caseId, $this->_moveToTrash)) { $deleted++; } else { $failed++; } } 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'); } } }