addDefaultButtons(ts('Delete Contributions'), 'done'); } /** * Process the form after the input has been submitted and validated. */ public function postProcess() { $deleted = $failed = 0; foreach ($this->_contributionIds as $contributionId) { if (CRM_Contribute_BAO_Contribution::deleteContribution($contributionId)) { $deleted++; } else { $failed++; } } if ($deleted) { $msg = ts('%count contribution deleted.', array('plural' => '%count contributions 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'); } } }