protected void btnApprove_Click(object sender, EventArgs e) { bool nextStepIsPublished = false; if (Node != null) { // Check modify permissions if (CheckPermissions && (CMSContext.CurrentUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)) { return; } // Raise event RaiseOnBeforeApprove(sender, e); // Approve the document - Go to next workflow step // Get original step WorkflowStepInfo originalStep = WorkflowMan.GetStepInfo(Node); // Approve the document WorkflowStepInfo nextStep = WorkflowMan.MoveToNextStep(Node, ""); if (nextStep != null) { nextStepIsPublished = (nextStep.StepName.ToLower() == "published"); // Send workflow e-mails if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSSendWorkflowEmails")) { WorkflowMan.SendWorkflowEmails(Node, CMSContext.CurrentUser, originalStep, nextStep, nextStepIsPublished ? WorkflowActionEnum.Published : WorkflowActionEnum.Approved, string.Empty); } } ReloadMenu(); string siteName = CMSContext.CurrentSiteName; // Refresh content tree when step is 'Published' or scope has been removed and icons should be displayed if ((nextStepIsPublished || (nextStep == null)) && (UIHelper.DisplayPublishedIcon(siteName) || UIHelper.DisplayVersionNotPublishedIcon(siteName) || UIHelper.DisplayNotPublishedIcon(siteName))) { RefreshTree(Node.NodeParentID, NodeID); } } if (EnablePassiveRefresh) { PassiveRefresh(NodeID); } }
protected void btnReject_Click(object sender, EventArgs e) { // Reject the document - Go to previous workflow step if (Node != null) { // Check modify permissions if (CheckPermissions && (CMSContext.CurrentUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)) { return; } // Raise event RaiseOnBeforeReject(sender, e); // Get original step WorkflowStepInfo originalStep = WorkflowMan.GetStepInfo(Node); // Reject the document WorkflowStepInfo previousStep = WorkflowMan.MoveToPreviousStep(Node, ""); // Send workflow e-mails if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSSendWorkflowEmails")) { WorkflowMan.SendWorkflowEmails(Node, CMSContext.CurrentUser, originalStep, previousStep, WorkflowActionEnum.Rejected, ""); } ReloadMenu(); string siteName = CMSContext.CurrentSiteName; if (UIHelper.DisplayCheckedOutIcon(siteName) || UIHelper.DisplayNotPublishedIcon(siteName)) { RefreshTree(Node.NodeParentID, NodeID); } } if (EnablePassiveRefresh) { PassiveRefresh(NodeID); } }