3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class provides the functionality to delete a group of
20 * Activities. This class provides functionality for the actual
23 class CRM_Activity_Form_Task_Delete
extends CRM_Activity_Form_Task
{
26 * Are we operating in "single mode", i.e. deleting one
31 protected $_single = FALSE;
34 * Build all the data structures needed to build the form.
36 public function preProcess() {
41 * Build the form object.
43 public function buildQuickForm() {
44 $this->addDefaultButtons(ts('Delete Activities'), 'done');
48 * Process the form after the input has been submitted and validated.
50 public function postProcess() {
51 $deleted = $failed = 0;
52 foreach ($this->_activityHolderIds
as $activityId['id']) {
53 $moveToTrash = CRM_Case_BAO_Case
::isCaseActivity($activityId['id']);
54 if (CRM_Activity_BAO_Activity
::deleteActivity($activityId, $moveToTrash)) {
63 $msg = ts('%count activity deleted.', ['plural' => '%count activities deleted.', 'count' => $deleted]);
64 CRM_Core_Session
::setStatus($msg, ts('Removed'), 'success');
68 CRM_Core_Session
::setStatus(ts('1 could not be deleted.', ['plural' => '%count could not be deleted.', 'count' => $failed]), ts('Error'), 'error');