}
     $url = '?leavecode=Leave&action=Leave_Summary&message=' . $mes . "&id={$id}&year={$year}&leaveTypeId={$leaveTypeId}&searchBy={$searchBy}";
     if ($sortBy != null && $sortOrder != null) {
         $url .= "&sortField={$sortBy}&sortOrder{$sortBy}={$sortOrder}";
     }
     $leaveController->redirect(null, array($url));
     break;
 case 'Leave_CancelLeave':
     // TODO: Check whether this is no loger used, and if so, remove this case
     $objs = $leaveExtractor->parseDeleteData($_POST);
     $mes = "Empty record";
     if (isset($objs)) {
         foreach ($objs as $obj) {
             $leaveController->setObjLeave($obj);
             $leaveController->setId($obj->getLeaveId());
             $mes = $leaveController->changeStatus();
         }
     }
     $leaveController->sendCancelledLeaveNotification($objs);
     $leaveController->redirect("");
     break;
 case 'Leave_CancelTakenLeaves':
     $objArr = $leaveTakenExtractor->parseUpdateData($_POST);
     if ($leaveController->updateTakenLeaves($objArr)) {
         $leaveController->redirect("Success");
     } else {
         $leaveController->redirect("Failiure");
     }
     break;
 case 'Leave_ChangeStatus':
     //changes made here to avoid sending mail notifications when clicked the save button without changing leave status