Exemplo n.º 1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (CultureInfo.CurrentCulture.Name != "en-GB")
                    rdbtnlst_RejectionReasons.DataTextField = "description-" + CultureInfo.CurrentCulture.Name;
                if (!UserInfo.IsInRole("Administrator") && !UserInfo.IsInRole("Collaborator"))
                {

                        lnkbtn_ApproveThread.Visible = false;
                        lnkbtn_RejectThread.Visible = false;

                }
                if (Request.QueryString["threadid"] != null)
                {
                   int threadId = Convert.ToInt32(Request.QueryString["threadid"]);
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    if (util.GetPhaseId(threadId) > 1)
                    {
                        lblPhase1Instructions.Visible = false;
                        lblPhase2Instructions.Visible = true;

                        hprlnk_GoToCurrentThreadPhase.NavigateUrl = util.GetTopicCurrentPhaseUrl(Request.QueryString["facebook"] != null, threadId, CultureInfo.CurrentCulture.Name);
                        hprlnk_GoToCurrentThreadPhase.Visible = true;

                        // We also hide the Collaborator buttons for moving topic to phase 2
                        lnkbtn_ApproveThread.Visible = false;
                        lnkbtn_RejectThread.Visible = false;

                    }
                    else
                    {
                        lblPhase1Instructions.Visible = true;
                        lblPhase2Instructions.Visible = false;
                        hprlnk_GoToCurrentThreadPhase.Visible = false;
                    }
                }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "script1", (this.TemplateSourceDirectory + "/js/proposals.js?v=1"));

                string resource = LocalResourceFile.Replace("footer_module", "View.ascx.resx");

                this.BasePage.Title = DotNetNuke.Services.Localization.Localization.GetString("pageTitle.Text", LocalResourceFile);
                   // this.BasePage.Title = lblPageTitle.Text;
                  //  this.BasePage.Title = "Test";

                if (Request.QueryString["facebook"] != null)
                {
                    isFacebook = true;
                }
                if (Request.QueryString["threadId"] != null)
                {
                    int threadId = Convert.ToInt32(Request.QueryString["threadId"].ToString());
                    currentThreadId = threadId;
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    currentPhaseId = util.GetPhaseId(threadId);
                    if (UserInfo.IsInRole("Collaborator"))
                    {

                        pnlAdminInstructions.Visible = true;

                        int featuredSolutions = GetFeaturedSolutionsCount(threadId);
                        lblFeaturedCount.Text = featuredSolutions.ToString();
                        if (featuredSolutions > 2 && currentPhaseId == 2)
                        {
                            lnkbtnPromoteToPhase3.Visible = true;
                        }
                        else
                        {
                            lnkbtnPromoteToPhase3.Visible = false;
                        }
                        if ((currentPhaseId == 3) && Request.QueryString["mode"] != null)
                        {
                            //pnlNotInPhase2.Visible = true;

                            pnlAdminInPhase3.Visible = true;
                        }
                        if ((currentPhaseId == 3) && Request.QueryString["mode"] == null)
                        {
                            pnlInWrongPhase.Visible = true;
                            pnlInPhase3.Visible = true;

                        }

                        else if ((currentPhaseId == 4) && Request.QueryString["mode"] != null)
                        {
                            //pnlNotInPhase2.Visible = true;
                            pnlAdminInPhase3.Visible = true;
                        }

                        else
                        {
                            pnlInPhase2.Visible = true;
                        }

                    }
                    string lang = CultureInfo.CurrentCulture.ToString();
                    if (currentPhaseId == 3)
                    {
                        if (Request.QueryString["mode"] == null)
                        {
                            pnlInWrongPhase.Visible = true;
                            pnlNotInPhase2.Visible = true;
                            pnlInPhase3.Visible = true;

                            string[] parameters1 = new string[2];
                            parameters1 = new string[2] { "threadid=" + threadId, "mode=featured" };
                            hprlnk_GoToPhase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters1).Replace("language/en-GB","language/"+ CultureInfo.CurrentCulture.ToString());

                            if (isFacebook)
                            {
                                Dictionary<string, int> tabs = new Dictionary<string, int>();
                                tabs.Add("en-GB", 279);
                                tabs.Add("el-GR", 280);
                                tabs.Add("cs-CZ", 281);
                                tabs.Add("de-AT", 282);
                                int voteTab = tabs[lang];
                                string[] parameters = new string[3];
                                parameters = new string[3] { "threadid=" + threadId, "mode=featured", "facebook=1" };
                                hprlnk_GoToPhase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);
                            }
                            else
                            {
                                string[] parameters = new string[2];
                                parameters = new string[2] { "threadid=" + threadId, "mode=featured" };
                                hprlnk_GoToPhase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                            }

                        }

                    }
                    else if (currentPhaseId == 4)
                    {

                        pnlInWrongPhase.Visible = true;
                        pnlInPhase4.Visible = true;
                        pnlAdminInPhase3.Visible = false;
                        Label2.Visible = false;
                        if (isFacebook)
                        {
                            Dictionary<string, int> tabs = new Dictionary<string, int>();
                            tabs.Add("en-GB", 275);
                            tabs.Add("el-GR", 276);
                            tabs.Add("cs-CZ", 277);
                            tabs.Add("de-AT", 278);
                            int voteTab = tabs[lang];
                            string[] parameters = new string[2];
                            parameters = new string[2] { "result=" + threadId, "facebook=1" };
                            hprlnk_GoToPhase4.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);
                        }
                        else
                        {
                            string[] parameters = new string[1];
                            parameters = new string[1] { "result=" + threadId };
                            hprlnk_GoToPhase4.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(196, "", parameters);
                        }

                                               }

                }

                lstvw_AllProposals.DataSource = sqldtsrc_AllProposals;
                if (Request.QueryString["mode"] != null)
                {
                    if (Request.QueryString["mode"] == "featured")
                    {
                        lstvw_AllProposals.DataSource = sqldtsrc_AllProposalsFeatured;

                    }
                }
                if (Request.QueryString["threadId"] != null)
                {
                    hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();
                    sqldtsrc_submittedProposals.DataBind();
                }
                lstvw_AllProposals.DataBind();
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }