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 restore a group of participations.
21 class CRM_Case_Form_Task_Restore
extends CRM_Case_Form_Task
{
24 * Are we operating in "single mode", i.e. deleting one
29 protected $_single = FALSE;
32 * Build all the data structures needed to build the form.
34 public function preProcess() {
39 * Build the form object.
41 public function buildQuickForm() {
42 $this->addDefaultButtons(ts('Restore Cases'), 'done');
46 * Process the form after the input has been submitted and validated.
48 public function postProcess() {
49 $restoredCases = $failed = 0;
50 foreach ($this->_entityIds
as $caseId) {
51 if (CRM_Case_BAO_Case
::restoreCase($caseId)) {
60 $msg = ts('%count case restored from trash.', [
61 'plural' => '%count cases restored from trash.',
62 'count' => $restoredCases,
64 CRM_Core_Session
::setStatus($msg, ts('Restored'), 'success');
68 CRM_Core_Session
::setStatus(ts('1 could not be restored.', ['plural' => '%count could not be restored.', 'count' => $failed]), ts('Error'), 'error');