/// <summary>
        /// Builds Tabs for Forms
        /// </summary>
        /// <param name="dashboardOrganizer">
        /// UPMOrganizer
        /// </param>
        /// <param name="form">
        /// Form
        /// </param>
        private void BuildFormTabs(UPMOrganizer dashboardOrganizer, Form form)
        {
            var count = form.NumberOfTabs;

            for (int i = 0; i < count; i++)
            {
                var parameterDictionary = new Dictionary <string, object> {
                    { "ConfigTabNr", i.ToString() }
                };
                var pageViewReference = ViewReference.ViewReferenceWith(parameterDictionary);
                pageViewReference = pageViewReference.ViewReferenceWith(RecordIdentification);
                var pageModelController = PageForViewReference(pageViewReference);
                if (pageModelController != null)
                {
                    FormTab tab = form.TabAtIndex(i);
                    if (i == 0 && tab.AttributeForKey("Color") != null)
                    {
                        Organizer.OrganizerColor = AureaColor.ColorWithString(tab.AttributeForKey("Color"));
                    }

                    pageModelController.Page.Parent    = dashboardOrganizer;
                    pageModelController.Page.LabelText = tab.Label;
                    AddPageModelController(pageModelController);
                    dashboardOrganizer.AddPage(pageModelController.Page);
                }
            }
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictOrganizer"))
            {
                ExpandFound                  = true,
                DisplaysTitleText            = true,
                LineCountAdditionalTitletext = 1,
                SubtitleText                 = LocalizedString.TextSyncConflictsTitle,
                TitleText           = this.SyncConflict.MainField.StringValue,
                AdditionalTitleText = (string)this.SyncConflict.DetailField?.FieldValue
            };

            this.ShouldShowTabsForSingleTab = false;
            if (this.IsDiscardAllowed())
            {
                UPMOrganizerAction discardAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.discard"))
                {
                    LabelText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic,
                                                         LocalizationKeys.KeyBasicSyncConflictsActionDiscardChanges, "DISCARD CONFLICT"),
                    IconName = "Icon:Trash"
                };

                discardAction.SetTargetAction(this, this.DiscardError);
                this.AddOrganizerHeaderActionItem(discardAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
        /// <summary>
        /// Builds SubViews for Headers
        /// </summary>
        /// <param name="dashboardOrganizer">
        /// UPMOrganizer
        /// </param>
        /// <param name="header">
        /// UPConfigHeader
        /// </param>
        private void BuildHeaderSubViews(UPMOrganizer dashboardOrganizer, UPConfigHeader header)
        {
            var count = header?.NumberOfSubViews ?? 0;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    var subViewDef           = header?.SubViewAtIndex(i);
                    var subViewViewReference = subViewDef?.ViewReference;
                    subViewViewReference = subViewViewReference?.ViewReferenceWith(RecordIdentification);
                    if (subViewViewReference == null)
                    {
                        continue;
                    }

                    var pageModelController = PageForViewReference(subViewViewReference);
                    if (pageModelController != null)
                    {
                        pageModelController.Page.Invalid   = true;
                        pageModelController.Page.LabelText = subViewDef.Label;
                        pageModelController.Page.Parent    = dashboardOrganizer;
                        AddPageModelController(pageModelController);
                        dashboardOrganizer.AddPage(pageModelController.Page);
                    }
                }
            }
        }
Exemple #4
0
        private void ContinueBuildPagesFromViewReference()
        {
            UPCharacteristicsEditPageModelController pageModelController = new UPCharacteristicsEditPageModelController(this.ViewReference, this.RecordIdentification, (UPOfflineCharacteristicsRequest)this.conflictEditOfflineRequest);
            UPMOrganizer organizer  = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditCharacteristics"));
            string       infoAreaId = this.RecordIdentification.InfoAreaId();

            organizer.TitleText = LocalizedString.TextEditCharacteristics;
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText = tableCaption?.TableCaptionForRecordIdentification(this.RecordIdentification);
            InfoArea infoAreaConfig = ConfigurationUnitStore.DefaultStore.InfoAreaConfigById(infoAreaId);

            organizer.SubtitleText = infoAreaConfig?.SingularName;
            if (string.IsNullOrEmpty(organizer.SubtitleText))
            {
                organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(infoAreaId).Label;
            }

            Page page = pageModelController.Page;

            page.LabelText = "Error";
            this.AddPageModelController(pageModelController);
            organizer.AddPage(page);
            this.TopLevelElement  = organizer;
            organizer.ExpandFound = true;
            this.AddOrganizerActions();
        }
Exemple #5
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictsOrganizer"))
            {
                ExpandFound  = true,
                SubtitleText = LocalizedString.TextSyncConflictsTitle
            };

            this.ShouldShowTabsForSingleTab = false;
            UPMOrganizerAction retryAction       = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.retry"));
            UPMOrganizerAction reportErrorAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.report"));
            string             retryText         = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsRetryAll, "Retry All");

            retryAction.LabelText = retryText;
            retryAction.IconName  = "Icon:Record";
            retryAction.SetTargetAction(this, this.RetryAll);
            this.AddOrganizerHeaderActionItem(retryAction);
            IOfflineStorage offlineStorage = UPOfflineStorage.DefaultStorage;

            if (!string.IsNullOrEmpty(ConfigurationUnitStore.DefaultStore.ConfigValue("Sync.ConflictEmailAddress")) &&
                offlineStorage.ConflictRequests?.Count > 1 &&
                !string.IsNullOrEmpty(offlineStorage.OfflineRequestXml()))
            {
                string sendRequestXmlText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsReportAllErrors, "Report all errors");
                reportErrorAction.LabelText = sendRequestXmlText;
                reportErrorAction.SetTargetAction(this, this.ReportAllErrors);
                this.AddOrganizerHeaderActionItem(reportErrorAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
        /// <summary>
        /// Builds the detail organizer pages.
        /// </summary>
        public void BuildDetailOrganizerPages()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement        = detailOrganizer;
            detailOrganizer.ExpandFound = true;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string          configName          = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(configName);

            if (layout == null)
            {
                return;
            }

            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            if (header == null)
            {
                headerName = "SYSTEMINFO.Expand";
                header     = configStore.HeaderByName(headerName);
            }

            if (header != null)
            {
                detailOrganizer.SubtitleText = header.Label;
                this.AddActionButtonsFromHeaderRecordIdentification(header, null);
            }
            else
            {
                detailOrganizer.SubtitleText = LocalizedString.TextSettings;
                UPMOrganizerAction action = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.edit"));
                action.SetTargetAction(this, this.SwitchToEdit);
                action.LabelText = LocalizedString.TextEdit;
                action.IconName  = "Button:Edit";
                this.AddOrganizerHeaderActionItem(action);
            }

            SettingsViewPageModelController detailPageModelController = new SettingsViewPageModelController(this.ViewReference);
            Page overviewPage = detailPageModelController.Page;

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
        }
Exemple #7
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPDataSyncPageModelController pageModelController = new UPDataSyncPageModelController();
            UPMOrganizer dataSynchronizationOrganizer         = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("DataSynchronization"));

            this.ShouldShowTabsForSingleTab = false;
            this.AddPageModelController(pageModelController);
            dataSynchronizationOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = dataSynchronizationOrganizer;
        }
Exemple #8
0
        private void BuildEditOrganizerPage()
        {
            UPMOrganizer organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditQuestionnaire"));

            this.TopLevelElement      = organizer;
            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            this.InfoAreaId           = this.RecordIdentification.InfoAreaId();
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = this.SurveyText;
            organizer.SubtitleText = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            QuestionnaireEditPageModelController pageModelController = new QuestionnaireEditPageModelController(this.ViewReference);

            this.AddPageModelController(pageModelController);
            organizer.AddPage(pageModelController.Page);
            this.AddOrganizerActions();
            organizer.ExpandFound = true;
        }
Exemple #9
0
        /// <summary>
        /// Adds Subview pages to UPMOrganizer
        /// </summary>
        /// <param name="expandHeader">
        /// <see cref="UPConfigHeader"/> configuration object
        /// </param>
        /// <param name="detailOrganizer">
        /// <see cref="UPMOrganizer"/> to add pages to
        /// </param>
        /// <param name="overviewPage">
        /// <see cref="Page"/> object to update LableText
        /// </param>
        private void UPMOrganizerAddPages(UPConfigHeader expandHeader, UPMOrganizer detailOrganizer, Page overviewPage)
        {
            var additionalParameters = new Dictionary <string, object> {
                { nameof(VirtualInfoAreaId), VirtualInfoAreaId }
            };

            if (expandHeader.SubViews != null)
            {
                foreach (UPConfigHeaderSubView subView in expandHeader.SubViews)
                {
                    if (subView.Options == "#")
                    {
                        overviewPage.LabelText = subView.Label;
                        continue;
                    }

                    UPPageModelController pageModelController = PageForViewReference(
                        subView.ViewReference?.ViewReferenceWith(additionalParameters).ViewReferenceWith(RecordIdentification));

                    if (pageModelController != null)
                    {
                        pageModelController.Page.Parent    = detailOrganizer;
                        pageModelController.Page.Invalid   = true;
                        pageModelController.Page.LabelText = subView.Label;
                        AddPageModelController(pageModelController);
                        if (pageModelController is UPWebContentPageModelController)
                        {
                            var webContentPageModelController = (UPWebContentPageModelController)pageModelController;
                            if (webContentPageModelController.AllowsXMLExport)
                            {
                                var exportXMLAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.exportXML"))
                                {
                                    LabelText = "Export XML"
                                };
                                AddOrganizerHeaderActionItem(exportXMLAction);
                            }
                        }

                        detailOrganizer.AddPage(pageModelController.Page);
                    }
                }
            }
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            ObjectivesEditPageModelController pageModelController = new ObjectivesEditPageModelController(this.ViewReference);
            UPMOrganizer organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditObjectives"));

            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            string infoAreaId = this.RecordIdentification.InfoAreaId();
            UPConfigTableCaption tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(infoAreaId).Label;
            Page page = pageModelController.Page;

            page.LabelText = "Error";
            this.AddPageModelController(pageModelController);
            organizer.AddPage(page);
            this.TopLevelElement  = organizer;
            organizer.ExpandFound = true;
            this.AddOrganizerActions();
        }
        private void BuildEditOrganizerPage()
        {
            var organizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("EditQuestionnaire"))
            {
                ExpandFound = true
            };

            this.TopLevelElement      = organizer;
            this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId");
            this.InfoAreaId           = this.RecordIdentification.InfoAreaId();
            var tableCaption = ConfigurationUnitStore.DefaultStore.TableCaptionByName(this.RecordIdentification.InfoAreaId());

            organizer.TitleText    = tableCaption.TableCaptionForRecordIdentification(this.RecordIdentification);
            organizer.SubtitleText = UPCRMDataStore.DefaultStore.TableInfoForInfoArea(this.InfoAreaId).Label;

            var pageModelController = new ContactTimesEditPageModelController(this.ViewReference);

            this.AddPageModelController(pageModelController);
            organizer.AddPage(pageModelController.Page);
            this.AddOrganizerActions();
        }
Exemple #12
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement = detailOrganizer;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            this.ConfigName = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(this.ConfigName);

            if (layout == null)
            {
                return;
            }

            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            detailOrganizer.TitleText = header != null ? header.Label : LocalizedString.TextSettings;

            EditSettingsPageModelController detailPageModelController = new EditSettingsPageModelController(this.ViewReference);
            Page overviewPage = detailPageModelController.Page;

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
            this.AddOrganizerActions();
            detailOrganizer.ExpandFound = true;
        }