Esempio n. 1
0
    /// <summary>
    /// Initializes and updates breadcrumbs items.
    /// </summary>
    private void SetupBreadcrumbs()
    {
        ucBreadcrumbs.Items.Clear();

        ucBreadcrumbs.AddBreadcrumb(new BreadcrumbItem
        {
            Text          = GetString("abuse.reports"),
            OnClientClick = ControlsHelper.GetPostBackEventReference(lnkBackHidden) + "; return false;"
        });

        int reportID = ValidationHelper.GetInteger(ucAbuseEdit.ReportID, 0);

        if (!String.IsNullOrEmpty(hfEditReport.Value))
        {
            reportID = ValidationHelper.GetInteger(hfEditReport.Value, 0);
        }

        AbuseReportInfo ari = AbuseReportInfoProvider.GetAbuseReportInfo(reportID);

        if (ari != null)
        {
            ucBreadcrumbs.AddBreadcrumb(new BreadcrumbItem
            {
                Text = ari.ReportTitle,
            });
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Ensure modal dialog opening
        ScriptHelper.RegisterDialogScript(this);

        int reportID = QueryHelper.GetInteger("reportid", 0);

        ucAbuseEdit.ReportID = reportID;

        AbuseReportInfo ar = AbuseReportInfoProvider.GetAbuseReportInfo(reportID);

        // Set edited object
        EditedObject = ar;

        if (ar != null)
        {
            // Set breadcrumb
            PageBreadcrumbs.AddBreadcrumb(new BreadcrumbItem
            {
                Text = ar.ReportTitle
            });

            // Ensure that object belongs to current site or user is global admin
            if (!MembershipContext.AuthenticatedUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Admin) && (ar.ReportSiteID != SiteContext.CurrentSiteID))
            {
                RedirectToInformation(GetString("general.notassigned"));
            }
        }

        ucAbuseEdit.OnCheckPermissions += ucAbuseEdit_OnCheckPermissions;
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Set the page title
        CurrentMaster.Title.TitleText     = GetString("abuse.properties");
        CurrentMaster.Title.TitleImage    = GetImageUrl("Objects/CMS_AbuseReport/object.png");
        CurrentMaster.Title.HelpTopicName = "abusereport";

        int reportID = QueryHelper.GetInteger("reportid", 0);

        ucAbuseEdit.ReportID = reportID;

        // Initializes page breadcrumbs
        string[,] breadcrumbs = new string[2, 3];
        breadcrumbs[0, 0]     = GetString("abuse.reports");
        breadcrumbs[0, 1]     = "~/CMSModules/AbuseReport/AbuseReport_List.aspx";

        AbuseReportInfo ar = AbuseReportInfoProvider.GetAbuseReportInfo(reportID);

        // Set edited object
        EditedObject = ar;

        if (ar != null)
        {
            // Set breadcrumbs
            breadcrumbs[1, 0] = HTMLHelper.HTMLEncode(ar.ReportTitle);
        }

        CurrentMaster.Title.Breadcrumbs = breadcrumbs;
        ucAbuseEdit.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(ucAbuseEdit_OnCheckPermissions);
    }
Esempio n. 4
0
 /// <summary>
 /// Unigrid event handler.
 /// </summary>
 /// <param name="actionName">Name of action</param>
 /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
 protected void UniGrid_OnAction(string actionName, object actionArgument)
 {
     // Edit report
     if (actionName == "edit")
     {
         if (!UseEditOnPostback)
         {
             URLHelper.Redirect(UrlResolver.ResolveUrl("AbuseReport_Edit.aspx?reportid=" + actionArgument));
         }
         else
         {
             EditReportID = ValidationHelper.GetInteger(actionArgument, 0);
         }
     }
     // Delete report
     else if (actionName == "delete")
     {
         // Check permissions
         if (CheckPermissions("CMS.AbuseReport", "Manage"))
         {
             AbuseReportInfoProvider.DeleteAbuseReportInfo(ValidationHelper.GetInteger(actionArgument, 0));
         }
     }
     // Solve report
     else if (actionName == "solve")
     {
         // Check permissions
         if (CheckPermissions("CMS.AbuseReport", "Manage"))
         {
             AbuseReportInfo ari = AbuseReportInfoProvider.GetAbuseReportInfo(ValidationHelper.GetInteger(actionArgument, 0));
             if (ari != null)
             {
                 ari.ReportStatus = AbuseReportStatusEnum.Solved;
                 AbuseReportInfoProvider.SetAbuseReportInfo(ari);
             }
         }
     }
     // Reject report
     else if (actionName == "reject")
     {
         // Check permissions
         if (CheckPermissions("CMS.AbuseReport", "Manage"))
         {
             AbuseReportInfo ari = AbuseReportInfoProvider.GetAbuseReportInfo(ValidationHelper.GetInteger(actionArgument, 0));
             if (ari != null)
             {
                 ari.ReportStatus = AbuseReportStatusEnum.Rejected;
                 AbuseReportInfoProvider.SetAbuseReportInfo(ari);
             }
         }
     }
 }
Esempio n. 5
0
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || ai.ActivityType != PredefinedActivityType.ABUSE_REPORT)
        {
            return(false);
        }

        int nodeId = ai.ActivityNodeID;

        lblDocIDVal.Text = GetLinkForDocument(nodeId, ai.ActivityCulture);

        AbuseReportInfo ari = AbuseReportInfoProvider.GetAbuseReportInfo(ai.ActivityItemID);

        if (ari != null)
        {
            txtComment.Text = ari.ReportComment;
        }

        return(true);
    }
Esempio n. 6
0
    protected override void OnPreRender(EventArgs e)
    {
        if ((ucAbuseReportList.EditReportID != 0) || (!String.IsNullOrEmpty(hfEditReport.Value)))
        {
            ucAbuseEdit.Visible              = true;
            ucAbuseReportList.Visible        = false;
            ucAbuseReportList.StopProcessing = true;
            ucAbuseEdit.StopProcessing       = false;

            int reportID = 0;

            ucAbuseEdit.ReportID = ucAbuseReportList.EditReportID;

            bool editForceLoad = false;
            if (ucAbuseEdit.ReportID != 0)
            {
                hfEditReport.Value = ucAbuseEdit.ReportID.ToString();
                reportID           = ucAbuseEdit.ReportID;
                editForceLoad      = true;
            }

            ucAbuseEdit.ReloadData(editForceLoad);

            //Breadcrumbs
            lblEditBack.Text = " <span class=\"TitleBreadCrumbSeparator\">&nbsp;</span> ";
            lnkEditBack.Text = GetString("abuse.reports");

            if (!String.IsNullOrEmpty(hfEditReport.Value))
            {
                reportID = ValidationHelper.GetInteger(hfEditReport.Value, 0);
            }

            AbuseReportInfo ari = AbuseReportInfoProvider.GetAbuseReportInfo(reportID);
            if (ari != null)
            {
                lblEditNew.Text = HTMLHelper.HTMLEncode(ari.ReportTitle);
            }
            pnlHeader.Visible = true;
        }
        base.OnPreRender(e);
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Set the page title
        CurrentMaster.Title.TitleText     = GetString("abuse.properties");
        CurrentMaster.Title.TitleImage    = GetImageUrl("Objects/CMS_AbuseReport/object.png");
        CurrentMaster.Title.HelpTopicName = "abusereport";

        int reportID = QueryHelper.GetInteger("reportid", 0);

        ucAbuseEdit.ReportID = reportID;

        // Initializes page breadcrumbs
        string[,] breadcrumbs = new string[2, 3];
        breadcrumbs[0, 0]     = GetString("abuse.reports");
        breadcrumbs[0, 1]     = "~/CMSModules/AbuseReport/AbuseReport_List.aspx";

        AbuseReportInfo ar = AbuseReportInfoProvider.GetAbuseReportInfo(reportID);

        // Set edited object
        EditedObject = ar;

        if (ar != null)
        {
            // Set breadcrumbs
            breadcrumbs[1, 0] = HTMLHelper.HTMLEncode(ar.ReportTitle);

            // Ensure that object belongs to current site or user is global admin
            if (!CMSContext.CurrentUser.IsGlobalAdministrator && (ar.ReportSiteID != CMSContext.CurrentSiteID))
            {
                RedirectToInformation(GetString("general.notassigned"));
            }
        }

        CurrentMaster.Title.Breadcrumbs = breadcrumbs;
        ucAbuseEdit.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(ucAbuseEdit_OnCheckPermissions);
    }