addDefaultButtons(ts('Delete Memberships'), 'done'); } /** * Process the form after the input has been submitted and validated. * * * @return void */ public function postProcess() { $deleted = $failed = 0; foreach ($this->_memberIds as $memberId) { if (CRM_Member_BAO_Membership::del($memberId)) { $deleted++; } else { $failed++; } } if ($deleted) { $msg = ts('%count membership deleted.', ['plural' => '%count memberships deleted.', 'count' => $deleted]); CRM_Core_Session::setStatus($msg, ts('Removed'), 'success'); } if ($failed) { CRM_Core_Session::setStatus(ts('1 could not be deleted.', ['plural' => '%count could not be deleted.', 'count' => $failed]), ts('Error'), 'error'); } } }