Пример #1
0
 public static String TileView(long idTile, DashboardType type, Int32 idCommunity = -1, long fromIdDashboard = 0, WizardDashboardStep step = WizardDashboardStep.None)
 {
     return(tilemodulehome + "View.aspx?" + TileUrl(idTile, type, idCommunity, fromIdDashboard, step));
 }
Пример #2
0
        public static String TileList(DashboardType type, Boolean loadfromRecycleBin = false, Int32 idCommunity = -1, long idTile = 0, long fromIdDashboard = 0, WizardDashboardStep step = WizardDashboardStep.None)
        {
            String url = tilemodulehome;

            if (loadfromRecycleBin)
            {
                url = url + "RecycleBin.aspx?recycle=true";
            }
            else
            {
                url = url + "List.aspx?recycle=false";
            }
            url = url + (idCommunity > 0 ? "&idCommunity=" + idCommunity.ToString() : "");
            url = url + "&type=" + type.ToString();
            if (fromIdDashboard > 0)
            {
                url = url + "&fromIdDashboard=" + fromIdDashboard.ToString() + ((step == WizardDashboardStep.None) ? "" : "&step=" + step.ToString());
            }
            if (idTile > 0)
            {
                url = url + "&idTile=" + idTile.ToString() + "#tile" + idTile.ToString();
            }

            return(url);
        }
Пример #3
0
 public static String DashboardPreview(long idDashboard, DashboardType type, Int32 idCommunity = -1, WizardDashboardStep step = WizardDashboardStep.None)
 {
     return(dashboardmodulehome + "Preview.aspx?" + DashboardUrl(idDashboard, type, idCommunity) + ((step == WizardDashboardStep.None) ? "" : "&step=" + step.ToString()));
 }
Пример #4
0
 public static String DashboardTileReorder(WizardDashboardStep step, long idDashboard, DashboardType type, Int32 idCommunity = -1)
 {
     return(dashboardmodulehome + "ReorderTiles.aspx?&step=" + step.ToString() + "&" + DashboardUrl(idDashboard, type, idCommunity));
 }
Пример #5
0
        public void InitView(WizardDashboardStep step, long idDashboard, DashboardType dashboardType, Int32 idContainerCommunity)
        {
            View.IdDashboard = idDashboard;
            Person p = CurrentManager.GetPerson(UserContext.CurrentUserID);

            if (UserContext.isAnonymous || p == null)
            {
                View.DisplaySessionTimeout();
            }
            else if (step == WizardDashboardStep.None)
            {
                switch (dashboardType)
                {
                case DashboardType.Portal:
                    View.RedirectToUrl(RootObject.DashboardTileReorder(WizardDashboardStep.Tiles, idDashboard, dashboardType, idContainerCommunity));
                    break;

                default:
                    View.RedirectToUrl(RootObject.DashboardTileReorder(WizardDashboardStep.Modules, idDashboard, dashboardType, idContainerCommunity));
                    break;
                }
            }
            else
            {
                View.CurrentStep = step;

                liteDashboardSettings settings = CurrentManager.Get <liteDashboardSettings>(idDashboard);
                Int32 idDashboardCommunity     = (settings == null) ? ((dashboardType == DashboardType.Community) ? idContainerCommunity : 0) : settings.IdCommunity;
                List <lm.Comol.Core.Wizard.dtoNavigableWizardItem <dtoDashboardStep> > steps = Service.GetAvailableSteps(step, idDashboard, (settings == null) ? dashboardType : settings.Type, idDashboardCommunity);
                View.LoadWizardSteps(steps);


                ModuleDashboard permissions   = (dashboardType == DashboardType.Community) ? Service.GetPermission(idDashboardCommunity) : ModuleDashboard.CreatePortalmodule(p.TypeID);
                String          url           = lm.Comol.Core.Dashboard.Domain.RootObject.TileList(settings.Type, false, idDashboardCommunity, 0, idDashboard, step);
                Boolean         generateTiles = false;

                switch (step)
                {
                case WizardDashboardStep.CommunityTypes:
                    generateTiles = permissions.ManageTiles && permissions.Administration && (ServiceTiles.GetCommunityTypesWithoutTilesCount() > 0);
                    break;

                case WizardDashboardStep.Modules:
                case WizardDashboardStep.Tiles:
                    break;
                }
                View.InitializeView(step, url, generateTiles);
                View.DashboardType = dashboardType;
                if (settings == null)
                {
                    View.DisplayUnknownDashboard();
                    if (dashboardType == DashboardType.Community)
                    {
                        if (idContainerCommunity < 0)
                        {
                            idDashboardCommunity = UserContext.CurrentCommunityID;
                        }
                    }
                    else
                    {
                        idDashboardCommunity = 0;
                    }
                    View.IdContainerCommunity = idDashboardCommunity;
                }
                else
                {
                    View.DashboardType        = settings.Type;
                    View.IdContainerCommunity = idDashboardCommunity;

                    if (permissions.Edit || permissions.Administration)
                    {
                        View.SetBackUrl(RootObject.DashboardList(dashboardType, false, idContainerCommunity));
                    }
                    if (settings.Deleted != BaseStatusDeleted.None)
                    {
                        View.DisplayDeletedDashboard();
                    }
                    else if (permissions.Edit || permissions.Administration)
                    {
                        View.AllowSave = (settings.Deleted == BaseStatusDeleted.None);
                        View.SetPreviewUrl(RootObject.DashboardPreview(settings.Id, settings.Type, settings.IdCommunity, step));
                        LoadTiles(step, idDashboard, idDashboardCommunity);
                    }
                    else
                    {
                        View.DisplayNoPermission(idDashboardCommunity, CurrentIdModule);
                    }
                }
            }
        }
Пример #6
0
 private void LoadTiles(WizardDashboardStep step, long idDashboard, Int32 idContainerCommunity)
 {
     View.LoadTiles(Service.DashboardGetTilesForReorder(idDashboard, step));
     View.SendUserAction(idContainerCommunity, Service.ServiceModuleID(), idDashboard, ModuleDashboard.ActionType.DashboardSettingsTilesStartReorder);
 }