protected void Page_Load(object sender, EventArgs e)
 {
     foreach (string style in new[] { "Vendors/ImageAreaSelect/imgareaselect-default.min" })
     {
         SPPageContentManager.RegisterStyleFile(LAYOUT_PATH + "stylesheets/" + style + ".css");
     }
 }
Exemple #2
0
        protected override void OnPreRender(EventArgs e)
        {
            SPContext context = SPContext.Current;
            SPWeb     web     = context.Web;

            SEID = Guid.NewGuid();

            string layoutPath = web.SafeServerRelativeUrl() + "/_layouts/15/epmlive/";

            SPPageContentManager.RegisterStyleFile(layoutPath + "stylesheets/SocialStream.min.css");

            EPMLiveScriptManager.RegisterScript(Page, new[]
            {
                "libraries/jquery.min", "libraries/handlebars-v1.3.0", "@libraries/amplify",
                "@libraries/bundles/moment", "@EPMLive.SocialStream"
            });

            SetTimeZone(web, context);

            CurrentUserDisplayName = EPMLiveCore.CoreFunctions.GetSafeUserTitle(Convert.ToString(web.CurrentUser.Name));

            try
            {
                var picture =
                    (string)(web.SiteUserInfoList.Items.GetItemById(web.CurrentUser.ID)["Picture"] ?? string.Empty);
                CurrentUserAvatar = string.IsNullOrEmpty(picture) ? string.Empty : picture.Split(',')[0].Trim();
            }
            catch { }
        }
Exemple #3
0
        // Protected Methods (2) 

        protected override void OnPreRender(EventArgs e)
        {
            SPPageContentManager.RegisterStyleFile(LAYOUT_PATH + "stylesheets/notifications.v2.min.css");

            EPMLiveScriptManager.RegisterScript(Page, new[] { "libraries/jquery.min", "@EPMLive.Notifications.v2" });

            GetProfilePicture();
        }
Exemple #4
0
        private void RegisterScripts()
        {
            foreach (string style in new[] { "MyWorkWebPart.min" })
            {
                SPPageContentManager.RegisterStyleFile(LAYOUT_PATH + style + ".css");
            }

            EPMLiveScriptManager.RegisterScript(Page, new[]
            {
                "libraries/jquery.min", "@EPM", "/treegrid/GridE", "/xml2json", "/MD5", "@/MyWorkWebPart", "GanttGrid"
            });

            ServicePointManager.ServerCertificateValidationCallback += delegate { return(true); };
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            foreach (string style in new[] { "upgrader.min" })
            {
                SPPageContentManager.RegisterStyleFile(LAYOUT_PATH + "stylesheets/" + style + ".css");
            }

            EPMLiveScriptManager.RegisterScript(Page, new[]
            {
                "@EPMLive.Upgrader"
            });
        }
Exemple #6
0
        // Protected Methods (1) 

        protected void Page_Load(object sender, EventArgs e)
        {
            string layoutPath = SPContext.Current.Web.SafeServerRelativeUrl() + "/_layouts/15/epmlive/";

            SPPageContentManager.RegisterStyleFile(layoutPath + "stylesheets/SocialStream.Logs.min.css");
            SPPageContentManager.RegisterStyleFile(layoutPath + "javascripts/libraries/highlight/styles/vs.css");

            EPMLiveScriptManager.RegisterScript(Page, new[]
            {
                "libraries/jquery.min", "libraries/handlebars-v1.3.0",
                "@libraries/amplify", "@libraries/bundles/moment",
                "libraries/highlight/highlight.pack", "@EPMLive.SocialStream.Logs"
            });

            SetTimeZone(SPContext.Current.Web, SPContext.Current);
        }
        /// <summary>
        ///     Raises the <see cref="E:System.Web.UI.Control.PreRender" /> event.
        /// </summary>
        /// <param name="e">
        ///     An <see cref="T:System.EventArgs" /> object that contains the event data.
        /// </param>
        protected override void OnPreRender(EventArgs e)
        {
            _currentWeb = SPContext.Current.Web;
            _reqWebId   = Convert.ToString(_currentWeb.ID);

            SPList resourcesList;

            if (_currentWeb.IsRootWeb && string.IsNullOrEmpty(Request["listId"]) && string.IsNullOrEmpty(Request["id"]))
            {
                resourcesList = _currentWeb.Lists.TryGetList("Resources");
            }
            else
            {
                resourcesList = _currentWeb.Lists.TryGetList("Team");
            }

            if (resourcesList != null)
            {
                foreach (string style in new[] { "libraries/jquery-ui" })
                {
                    SPPageContentManager.RegisterStyleFile(LAYOUT_PATH + "stylesheets/" + style + ".css");
                }

                EPMLiveScriptManager.RegisterScript(Page, new[]
                {
                    "libraries/jquery.min", "@EPM", "/treegrid/GridE", "@EPMLive.ResourceGrid"
                });

                ServicePointManager.ServerCertificateValidationCallback += delegate { return(true); };
            }
            else
            {
                lblError.Text = @"<b>ERROR: </b>There is no ""Resources"" list at this level.";

                pnlGrid.Visible  = false;
                pnlError.Visible = true;
            }
            var gSettings = new GridGanttSettings(resourcesList);

            if (string.IsNullOrEmpty(gSettings.RibbonBehavior))
            {
                RibbonBehavior = 0;
            }
            else
            {
                RibbonBehavior = Convert.ToInt16(gSettings.RibbonBehavior);
            }

            SPRibbon spRibbon = SPRibbon.GetCurrent(Page);

            if (spRibbon != null)
            {
                if (!CurrentUserHaveResourceCenterPermission(SPBasePermissions.AddListItems))
                {
                    spRibbon.TrimById("Ribbon.ResourceGrid.New.NewItem", "false");
                }
                if (!CurrentUserHaveResourceCenterPermission(SPBasePermissions.EditListItems))
                {
                    spRibbon.TrimById("Ribbon.ResourceGrid.Manage.EditItem", "false");
                }
                if (!CurrentUserHaveResourceCenterPermission(SPBasePermissions.DeleteListItems))
                {
                    spRibbon.TrimById("Ribbon.ResourceGrid.Manage.DeleteItem", "false");
                }
            }
        }