예제 #1
0
        //protected String popupMessage = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            SPSite site = SPContext.Current.Site;

            recordsTypes    = WBTaxonomy.GetRecordsTypes(site);
            seriesTags      = WBTaxonomy.GetSeriesTags(recordsTypes);
            functionalAreas = WBTaxonomy.GetFunctionalAreas(recordsTypes);

            WBUtils.logMessage("Records Types object has been recreated");

            functionalAreas.InitialiseTaxonomyControl(DefaultFunctionalArea, "Select Default Functional Area", false, false, this);

            recordsTypes.InitialiseTaxonomyControl(DefaultRecordsType, "Select Default Publishing Out Records Type", false, false, this);

            seriesTags.InitialiseTaxonomyControl(DocumentSeriesTagParentTerm, "Select the Series Tag Parent", false, true, this);
            seriesTags.InitialiseTaxonomyControl(WorkBoxSeriesTagParentTerm, "Select the Series Tag Parent", false, true, this);

            if (!IsPostBack)
            {
                TreeViewTermCollection collection = new TreeViewTermCollection(recordsTypes.TermSet);

                // Bind the data source to your collection
                AllRecordsTypesTreeView.DataSource = collection;
                AllRecordsTypesTreeView.DataBind();
            }
        }
        void PopulateControls()
        {
            if (!IsPostBack)
            {
                WBCollection collection = new WBCollection(SPContext.Current);

                WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site);

                teams.InitialiseTaxonomyControl(SystemAdminTeams, "Select the System Admin Teams", true);
                SystemAdminTeams.Text = collection.SystemAdminTeams.UIControlValue;

                teams.InitialiseTaxonomyControl(BusinessAdminTeams, "Select the Business Admin Teams", true);
                BusinessAdminTeams.Text = collection.BusinessAdminTeams.UIControlValue;

                NameOfAllWorkBoxesList.Text = collection.ListName;

                if (collection.EventReceiversAdded)
                {
                    EventReceiverStatus.Text = "<i>(Event receiver <b>has</b> been added)</i>";
                }

                GenerateUniqueIds.Checked            = collection.GenerateUniqueIDs;
                WorkBoxCollectionUniqueIdPrefix.Text = collection.UniqueIDPrefix;
                NumberOfDigitsInIds.Text             = collection.NumberOfDigitsInIDs.ToString();
                InitialIdOffset.Text = collection.InitialIDOffset.ToString();

                CanAnyoneCreate.Checked = collection.CanAnyoneCreate;

                SysadminOpen.Text = collection.OpenPermissionLevelForSystemAdmin;
                AdminOpen.Text    = collection.OpenPermissionLevelForBusinessAdmin;
                OwnerOpen.Text    = collection.OpenPermissionLevelForOwner;
                InvolvedOpen.Text = collection.OpenPermissionLevelForInvolved;
                VisitorsOpen.Text = collection.OpenPermissionLevelForVisitors;
                EveryoneOpen.Text = collection.OpenPermissionLevelForEveryone;

                SysadminClosed.Text = collection.ClosedPermissionLevelForSystemAdmin;
                AdminClosed.Text    = collection.ClosedPermissionLevelForBusinessAdmin;
                OwnerClosed.Text    = collection.ClosedPermissionLevelForOwner;
                InvolvedClosed.Text = collection.ClosedPermissionLevelForInvolved;
                VisitorsClosed.Text = collection.ClosedPermissionLevelForVisitors;
                EveryoneClosed.Text = collection.ClosedPermissionLevelForEveryone;

                UseFolderAccessGroupsPattern.Checked      = collection.UseFolderAccessGroupsPattern;
                FolderAccessGroupsPrefix.Text             = collection.FolderAccessGroupsPrefix;
                FolderAccessGroupsFolderNames.Text        = collection.FolderAccessGroupsFolderNames;
                FolderAccessGroupPermissionLevel.Text     = collection.FolderAccessGroupPermissionLevel;
                AllFoldersAccessGroupPermissionLevel.Text = collection.AllFoldersAccessGroupPermissionLevel;

                NewWorkBoxDialogUrl.Text  = collection.UrlForNewWorkBoxDialog;
                CreateNewWorkBoxText.Text = collection.CreateNewWorkBoxText;

                teams.InitialiseTaxonomyControl(DefaultOwningTeam, "Select the Default Owning Team", false);
                DefaultOwningTeam.Text = collection.DefaultOwningTeamUIControlValue;

                UsesLinkedCalendars.Checked = collection.UsesLinkedCalendars;

                ReturnUrl.Value = Request.QueryString["ReturnUrl"];
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!WorkBox.CurrentUserIsOwner() && !WorkBox.CurrentUserIsBusinessAdmin() && !WorkBox.CurrentUserIsSystemAdmin())
            {
                ErrorText.Text = "Only owners or admin can invite teams to have access to a work box.";
                return;
            }


            teamsTaxonomy = WBTaxonomy.GetTeams(SPContext.Current.Site);

            if (!IsPostBack)
            {
                WorkBoxTitle.Text = WorkBox.Title;

                InviteType.SelectedValue     = "Involved";
                CurrentlySelectedValue.Value = "Involved";

                SendInviteEmail.Checked = true;
                SendAsOne.Checked       = true;
                CCToYou.Checked         = true;

                EmailSubject.Text = WorkBox.Template.InviteInvolvedUserEmailSubject;
                EmailBody.Text    = WorkBox.Template.InviteInvolvedUserEmailBody;

                OtherEmailSubject.Value = WorkBox.Template.InviteVisitingUserEmailSubject;
                OtherEmailBody.Value    = WorkBox.Template.InviteVisitingUserEmailBody;

                teamsTaxonomy.InitialiseTaxonomyControl(TeamsToInviteControl, "Teams to invite", true);

                TeamsToInviteControl.Focus();

                DisposeWorkBox();
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(SPContext.Current.Site);
            subjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTag, "Subject Tag", false);

            farm     = WBFarm.Local;
            routings = farm.SubjectTagsRecordsRoutings(subjectTagsTaxonomy);

            if (!IsPostBack)
            {
                RouteIndex.Value = Request.QueryString["RouteIndex"];

                int index;
                if (Int32.TryParse(RouteIndex.Value, out index))
                {
                    WBSubjectTagRecordsRoutings routing = routings[index];

                    if (routing != null)
                    {
                        SubjectTag.Text               = routing.SubjectTag.UIControlValue;
                        PublicDocumentsLibrary.Text   = routing.PublicDocumentsLibrary;
                        ExtranetDocumentsLibrary.Text = routing.ExtranetDocumentsLibrary;
                    }
                }
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            recordsTypeTaxonomy = WBTaxonomy.GetRecordsTypes(WorkBox.Site);

            recordsTypeTaxonomy.InitialiseTaxonomyControl(RecordsTypeField, WorkBox.COLUMN_NAME__RECORDS_TYPE, false);


            if (!IsPostBack)
            {
                RecordsTypeField.Text = Request.QueryString["recordsTypeUIControlValue"];
            }
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SPSite site = SPContext.Current.Site;

            teams           = WBTaxonomy.GetTeams(site);
            functionalAreas = WBTaxonomy.GetFunctionalAreas(teams);

            functionalAreas.InitialiseTaxonomyControl(TeamFunctionalAreas, "Select Functional Area(s)", true, false, this);


            if (!IsPostBack)
            {
                TreeViewTermCollection collection = new TreeViewTermCollection();
                collection.Add(new TreeViewTerm(teams.TermSet));

                // Bind the data source to your collection
                AllTeamsTreeView.DataSource = collection;
                AllTeamsTreeView.DataBind();
            }
        }
        private void renderPage()
        {
            // OK, so now we're finally in a position to load up the values of the page fields:

            SourceDocIcon.AlternateText = "Icon of document being publishing out.";
            SourceDocIcon.ImageUrl      = WBUtils.DocumentIcon32(sourceDocAsItem.Url);

            TitleField.Text = sourceFile.Title;

            ReadOnlyNameField.Text = sourceDocAsItem.Name;
            NameField.Text         = sourceDocAsItem.Name;
            OriginalFileName.Text  = sourceDocAsItem.WBxGetColumnAsString(WorkBox.COLUMN_NAME__ORIGINAL_FILENAME);

            DocumentFileNamingConvention.Text = documentRecordsType.DocumentNamingConvention.Replace("<", "&lt;").Replace(">", "&gt;");

            RecordsTypeUIControlValue.Value     = documentRecordsType.UIControlValue;
            PickRecordsTypeButton.OnClientClick = "WorkBoxFramework_pickANewRecordsType(WorkBoxFramework_PublishDoc_pickedANewRecordsType, '" + documentRecordsType.UIControlValue + "'); return false;";
            RecordsType.Text = documentRecordsType.FullPath.Replace("/", " / ");


            WBTermCollection <WBTerm> functionalAreas = sourceDocAsItem.WBxGetMultiTermColumn <WBTerm>(functionalAreasTaxonomy, WorkBox.COLUMN_NAME__FUNCTIONAL_AREA);

            functionalAreaFieldIsEditable = documentRecordsType.IsFunctionalAreaEditable;
            if (functionalAreaFieldIsEditable)
            {
                functionalAreasTaxonomy.InitialiseTaxonomyControl(FunctionalAreaField, WorkBox.COLUMN_NAME__FUNCTIONAL_AREA, false, false, this);

                String functionalAreaValue = functionalAreas.UIControlValue;
                if (functionalAreaValue.Contains(";"))
                {
                    string[] allFunctionalValues = functionalAreaValue.Split(';');
                    functionalAreaValue = allFunctionalValues[0];
                }

                FunctionalAreaField.Text = functionalAreaValue;
            }
            else
            {
                ReadOnlyFunctionalAreaField.Text = functionalAreas.Names();
            }

            bool    userCanPublishToPublic = false;
            SPGroup publishersGroup        = WorkBox.OwningTeam.PublishersGroup(SPContext.Current.Site);

            if (publishersGroup != null)
            {
                if (publishersGroup.ContainsCurrentUser)
                {
                    userCanPublishToPublic = true;
                }
            }

            String selectedZone = WBRecordsType.PROTECTIVE_ZONE__PROTECTED;

            if (userCanPublishToPublic)
            {
                if (destinationType.Equals(WorkBox.PUBLISHING_OUT_DESTINATION_TYPE__PUBLIC_WEB_SITE))
                {
                    WBLogging.Generic.Verbose("In PUBLIC: The destination type was: " + destinationType);
                    selectedZone = WBRecordsType.PROTECTIVE_ZONE__PUBLIC;
                }
                else if (destinationType.Equals(WorkBox.PUBLISHING_OUT_DESTINATION_TYPE__PUBLIC_EXTRANET))
                {
                    WBLogging.Generic.Verbose("In PUBLIC EXTRANET: The destination type was: " + destinationType);
                    selectedZone = WBRecordsType.PROTECTIVE_ZONE__PUBLIC_EXTRANET;
                }
                else
                {
                    WBLogging.Generic.Verbose("The destination type was: " + destinationType);
                    selectedZone = WBRecordsType.PROTECTIVE_ZONE__PROTECTED;
                }
            }
            else
            {
                selectedZone = WBRecordsType.PROTECTIVE_ZONE__PROTECTED;
            }

            List <String> protectiveZoneList = new List <String>();

            protectiveZoneList.Add(selectedZone);

            ProtectiveZone.DataSource = protectiveZoneList;
            ProtectiveZone.DataBind();

            ProtectiveZone.SelectedValue = selectedZone;


            if (showSubjectTags)
            {
                if (documentRecordsType.IsDocumentSubjectTagsRequired)
                {
                    SubjectTagsTitle.Text = "Subject Tags" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    SubjectTagsTitle.Text = "Subject Tags (optional)";
                }
                SubjectTagsDescription.Text = documentRecordsType.DocumentSubjectTagsDescription;

                subjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTagsField, WorkBox.COLUMN_NAME__SUBJECT_TAGS, true, true, this);
                WBTermCollection <WBTerm> subjectTags = sourceDocAsItem.WBxGetMultiTermColumn <WBTerm>(subjectTagsTaxonomy, WorkBox.COLUMN_NAME__SUBJECT_TAGS);
                SubjectTagsField.Text = subjectTags.WBxToString();
            }


            if (showReferenceID)
            {
                if (documentRecordsType.IsDocumentReferenceIDRequired)
                {
                    ReferenceIDTitle.Text = "Reference ID" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ReferenceIDTitle.Text = "Reference ID (optional)";
                }
                ReferenceIDDescription.Text = documentRecordsType.DocumentReferenceIDDescription;
                ReferenceID.Text            = sourceDocAsItem.WBxGetColumnAsString(WorkBox.COLUMN_NAME__REFERENCE_ID);
            }

            if (showReferenceDate)
            {
                if (documentRecordsType.IsDocumentReferenceDateRequired)
                {
                    ReferenceDateTitle.Text = "Reference Date" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ReferenceDateTitle.Text = "Reference Date (optional)";
                }
                ReferenceDateDescription.Text = documentRecordsType.DocumentReferenceDateDescription;
                if (sourceDocAsItem.WBxColumnHasValue(WorkBox.COLUMN_NAME__REFERENCE_DATE))
                {
                    ReferenceDate.SelectedDate = (DateTime)sourceDocAsItem[WorkBox.COLUMN_NAME__REFERENCE_DATE];
                }
                else
                {
                    ReferenceDate.SelectedDate = DateTime.Now;
                }
            }

            if (showSeriesTag)
            {
                if (documentRecordsType.IsDocumentSeriesTagRequired)
                {
                    SeriesTagTitle.Text = "Series Tag" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    SeriesTagTitle.Text = "Series Tag (optional)";
                }
                SeriesTagDescription.Text = documentRecordsType.DocumentSeriesTagDescription;

                SeriesTagDropDownList.DataSource     = GetSeriesTagDataSource(documentRecordsType.DocumentSeriesTagParentTerm(seriesTagsTaxonomy));
                SeriesTagDropDownList.DataTextField  = "SeriesTagTermName";
                SeriesTagDropDownList.DataValueField = "SeriesTagTermUIControlValue";
                SeriesTagDropDownList.DataBind();

                if (sourceDocAsItem.WBxColumnHasValue(WorkBox.COLUMN_NAME__SERIES_TAG))
                {
                    SeriesTagDropDownList.SelectedValue = sourceDocAsItem.WBxGetSingleTermColumn <WBTerm>(seriesTagsTaxonomy, WorkBox.COLUMN_NAME__SERIES_TAG).UIControlValue;
                }
            }

            if (showScanDate)
            {
                if (documentRecordsType.IsDocumentScanDateRequired)
                {
                    ScanDateTitle.Text = "Scan Date" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ScanDateTitle.Text = "Scan Date (optional)";
                }
                ScanDateDescription.Text = documentRecordsType.DocumentScanDateDescription;
                if (sourceDocAsItem.WBxColumnHasValue(WorkBox.COLUMN_NAME__SCAN_DATE))
                {
                    ScanDate.SelectedDate = (DateTime)sourceDocAsItem[WorkBox.COLUMN_NAME__SCAN_DATE];
                }
            }

            teamsTaxonomy.InitialiseTaxonomyControl(OwningTeamField, WorkBox.COLUMN_NAME__OWNING_TEAM, false);
            TaxonomyFieldValue owningTeamValue = sourceDocAsItem[WorkBox.COLUMN_NAME__OWNING_TEAM] as TaxonomyFieldValue;

            OwningTeamField.Text = owningTeamValue.WBxUIControlValue();

            teamsTaxonomy.InitialiseTaxonomyControl(InvolvedTeamsField, WorkBox.COLUMN_NAME__INVOLVED_TEAMS, true);
            TaxonomyFieldValueCollection involvedTeamsValues = sourceDocAsItem[WorkBox.COLUMN_NAME__INVOLVED_TEAMS] as TaxonomyFieldValueCollection;

            InvolvedTeamsField.Text = involvedTeamsValues.WBxUIControlValue();


            if (functionalAreaFieldIsEditable)
            {
                FunctionalAreaField.Focus();
            }
            else
            {
                PickRecordsTypeButton.Focus();
            }
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SPSite site = SPContext.Current.Site;
                SPWeb  web  = SPContext.Current.Web;

                WBTaxonomy teams           = WBTaxonomy.GetTeams(site);
                WBTaxonomy functionalAreas = WBTaxonomy.GetFunctionalAreas(teams);

                teams.InitialiseTaxonomyControl(TeamTerm, "Select Team Term", false);
                teams.InitialiseTaxonomyControl(ParentTeamTerm, "Select the Parent Team Term", false);
                functionalAreas.InitialiseTaxonomyControl(TeamFunctionalAreas, "Select the functional area", true);

                TeamName.Text = web.Title;

                WBTeam team = WBTeam.GetFromTeamSite(teams, web);
                if (team != null)
                {
                    TeamTerm.Text    = team.UIControlValue;
                    TeamAcronym.Text = team.Acronym;

                    TeamFunctionalAreas.Text      = team.FunctionalAreaUIControlValue;
                    UseAllFunctionalAreas.Checked = team.UseAllFunctionalAreas;

                    if (TeamFunctionalAreas.Text == "")
                    {
                        InheritedFunctionalAreas.Text = team.FunctionalArea(functionalAreas).Names();
                    }
                    else
                    {
                        InheritedFunctionalAreas.Text = "";
                    }

                    InformationAssetOwner.WBxInitialise(team.InformationAssetOwner(web));
                    TeamManager.WBxInitialise(team.Manager(web));

                    TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.OwnersGroupName));
                    TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.MembersGroupName));
                    TeamPublishersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.PublishersGroupName));

                    TeamTerm.Enabled       = false;
                    ParentTeamTerm.Enabled = false;
                    TeamOwnersSharePointUserGroup.Enabled  = false;
                    TeamMembersSharePointUserGroup.Enabled = false;
                    RecordsTypesListUrl.Text = team.RecordsTypesListUrl;
                }
                else
                {
                    TeamTerm.Text = "";

                    SPWeb  parentWeb  = web.ParentWeb;
                    WBTeam parentTeam = WBTeam.GetFromTeamSite(teams, parentWeb);

                    if (parentTeam != null)
                    {
                        ParentTeamTerm.Text = parentTeam.UIControlValue;

                        InheritedFunctionalAreas.Text = parentTeam.FunctionalArea(functionalAreas).Names();

                        RecordsTypesListUrl.Text = parentTeam.RecordsTypesListUrl;
                    }

                    TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(web.Title + " - Owners"));
                    TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(web.Title + " - Members"));
                }
            }
        }
예제 #9
0
        private void renderPage()
        {
            if (pageRendered)
            {
                return;
            }

            WBLogging.Generic.Unexpected("Rendering 'New Work Box' page");

            WBCollection collection = new WBCollection(WorkBoxCollectionUrl.Value);

            CreateNewWorkBoxText.Text = workBoxRecordsType.CreateNewWorkBoxText;

            RecordsType.Text = workBoxRecordsType.FullPath.Replace("/", " / ");

            string namingConvention = workBoxRecordsType.WorkBoxNamingConvention;
            string uniqueIDprefix   = workBoxRecordsType.WorkBoxUniqueIDPrefix;

            if (uniqueIDprefix != "")
            {
                namingConvention = namingConvention.Replace("<Unique ID Prefix>", uniqueIDprefix);
                namingConvention = namingConvention.Replace("<UID Prefix>", uniqueIDprefix);
            }

            WorkBoxNamingConvention.Text = namingConvention.Replace("<", "&lt;").Replace(">", "&gt;");

            DataView templates = GetTemplatesDataSource(collection, workBoxRecordsType);

            if (templates.Count == 0)
            {
                NoTemplatesError.Text  = "There are no templates for this work box records type!";
                onlyOneWorkBoxTemplate = true;
            }
            else
            {
                if (templates.Count == 1)
                {
                    DataRow theTemplate = templates.Table.Rows[0];

                    onlyOneWorkBoxTemplate  = true;
                    WorkBoxTemplate.Text    = theTemplate["WorkBoxTemplateTextField"].WBxToString();
                    WorkBoxTemplateID.Value = theTemplate["WorkBoxTemplateValueField"].WBxToString();
                }
                else
                {
                    onlyOneWorkBoxTemplate          = false;
                    WorkBoxTemplates.DataSource     = templates;
                    WorkBoxTemplates.DataTextField  = "WorkBoxTemplateTextField";
                    WorkBoxTemplates.DataValueField = "WorkBoxTemplateValueField";
                    WorkBoxTemplates.DataBind();

                    WBTemplate defaultTemplate = collection.DefaultTemplate(workBoxRecordsType);
                    if (defaultTemplate != null)
                    {
                        WorkBoxTemplates.SelectedValue = defaultTemplate.ID.ToString();
                    }

                    // We're going to use the fact that this hidden field is blank to assume
                    // that there was more than one value:
                    WorkBoxTemplateID.Value = "";
                }
            }

            if (functionalAreaFieldIsEditable)
            {
                functionalAreas.InitialiseTaxonomyControl(FunctionalAreaField, WorkBox.COLUMN_NAME__FUNCTIONAL_AREA, true, true, null);

                if (!IsPostBack && functionalAreaInitialValue != null)
                {
                    FunctionalAreaField.Text = functionalAreaInitialValue;
                }
            }
            else
            {
                ReadOnlyFunctionalAreaField.Text = workBoxRecordsType.DefaultFunctionalArea(functionalAreas).Names();
            }


            // teams.InitialiseTaxonomyControl(OwningTeamField, WorkBox.COLUMN_NAME__OWNING_TEAM, false);

            teams.InitialiseTaxonomyControl(InvolvedTeamsField, WorkBox.COLUMN_NAME__INVOLVED_TEAMS, true);

            showShortTitle = workBoxRecordsType.WorkBoxShortTitleRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN;
            if (showShortTitle)
            {
                if (workBoxRecordsType.IsWorkBoxShortTitleRequired)
                {
                    ShortTitleTitle.Text = "Short Title" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ShortTitleTitle.Text = "Short Title (optional)";
                }
                ShortTitleDescription.Text = workBoxRecordsType.WorkBoxShortTitleDescription;
            }


            showReferenceID = workBoxRecordsType.WorkBoxReferenceIDRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN;
            if (showReferenceID)
            {
                if (workBoxRecordsType.IsWorkBoxReferenceIDRequired)
                {
                    ReferenceIDTitle.Text = "Reference ID" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ReferenceIDTitle.Text = "Reference ID (optional)";
                }
                ReferenceIDDescription.Text = workBoxRecordsType.WorkBoxReferenceIDDescription;
                //                    ReferenceID.Text = sourceDocAsItem.WBxGetColumnAsString(WorkBox.COLUMN_NAME__REFERENCE_ID);
            }

            showReferenceDate = workBoxRecordsType.WorkBoxReferenceDateRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN;
            if (showReferenceDate)
            {
                // Setting the local to a value that should make the date format DD/MM/YYYY
                // ReferenceDate.LocaleId = 2057;

                if (workBoxRecordsType.IsWorkBoxReferenceDateRequired)
                {
                    ReferenceDateTitle.Text = "Reference Date" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    ReferenceDateTitle.Text = "Reference Date (optional)";
                }
                ReferenceDateDescription.Text = workBoxRecordsType.WorkBoxReferenceDateDescription;

                /*
                 * if (sourceDocAsItem.WBxColumnHasValue(WorkBox.COLUMN_NAME__REFERENCE_DATE))
                 * {
                 *  ReferenceDate.SelectedDate = (DateTime)sourceDocAsItem[WorkBox.COLUMN_NAME__REFERENCE_DATE];
                 * }
                 * else
                 * {
                 * }
                 * */
            }

            showSeriesTag = workBoxRecordsType.WorkBoxSeriesTagRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN;
            if (showSeriesTag)
            {
                if (workBoxRecordsType.IsWorkBoxSeriesTagRequired)
                {
                    SeriesTagTitle.Text = "Series Tag" + WBConstant.REQUIRED_ASTERISK;
                }
                else
                {
                    SeriesTagTitle.Text = "Series Tag (optional)";
                }
                SeriesTagDescription.Text = workBoxRecordsType.DocumentSeriesTagDescription;

                SeriesTagDropDownList.DataSource     = GetSeriesTagsDataSource(workBoxRecordsType.WorkBoxSeriesTagParentTerm(seriesTags));
                SeriesTagDropDownList.DataTextField  = "SeriesTagTermName";
                SeriesTagDropDownList.DataValueField = "SeriesTagTermUIControlValue";
                SeriesTagDropDownList.DataBind();

                if (!IsPostBack && seriesTagInitialValue != "")
                {
                    if (SeriesTagDropDownList.Items.FindByValue(seriesTagInitialValue) != null)
                    {
                        SeriesTagDropDownList.SelectedValue = seriesTagInitialValue;
                    }
                }
            }


            ErrorMessageLabel.Text = errorMessage;

            if (functionalAreaFieldIsEditable)
            {
                FunctionalAreaField.Focus();
            }
            else
            {
                if (!onlyOneWorkBoxTemplate)
                {
                    WorkBoxTemplates.Focus();
                }
                else
                {
                    if (showShortTitle)
                    {
                        WorkBoxShortTitle.Focus();
                    }
                    else
                    {
                        // Just to have the focus somewhere:
                        InvolvedTeamsField.Focus();
                    }
                }
            }


            if (relatedWorkBox != null)
            {
                relatedWorkBox.Dispose();
            }

            collection.Dispose();

            pageRendered = true;
        }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // First we're going to check membership of the records management group:
            String  rmGroupName = WBFarm.Local.RecordsManagersGroupName;
            SPGroup rmGroup     = null;

            if (!String.IsNullOrEmpty(rmGroupName))
            {
                try
                {
                    rmGroup = SPContext.Current.Web.SiteGroups[rmGroupName];
                }
                catch (Exception exception)
                {
                    // Probably the group hasn't been created or setup here yet
                }
            }

            if (rmGroup == null || !rmGroup.ContainsCurrentUser)
            {
                AccessDeniedPanel.Visible          = true;
                UpdateRecordsMetadataPanel.Visible = false;
                return;
            }

            currentUserLoginName = SPContext.Current.Web.CurrentUser.LoginName;


            String listIDString   = "";
            String itemIDString   = "";
            String recordIDString = "";

            recordsTypesTaxonomy = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site);
            subjectTagsTaxonomy  = WBTaxonomy.GetSubjectTags(recordsTypesTaxonomy);

            librarySite = new SPSite(WBFarm.Local.ProtectedRecordsLibraryUrl);
            libraryWeb  = librarySite.OpenWeb();

            libraryList = libraryWeb.GetList(WBFarm.Local.ProtectedRecordsLibraryUrl);


            if (!IsPostBack)
            {
                recordIDString = Request.QueryString["RecordID"];

                if (String.IsNullOrEmpty(recordIDString))
                {
                    listIDString = Request.QueryString["ListID"];
                    itemIDString = Request.QueryString["ItemID"];
                }
                else
                {
                    listIDString = libraryList.ID.ToString();
                }

                ListID.Value = listIDString;
                ItemID.Value = itemIDString;
            }
            else
            {
                recordIDString = RecordID.Text;
                listIDString   = ListID.Value;
                itemIDString   = ItemID.Value;
            }

            if (!String.IsNullOrEmpty(itemIDString))
            {
                int itemID = Convert.ToInt32(itemIDString);

                recordItem = libraryList.GetItemById(itemID);
            }
            else
            {
                recordItem = WBUtils.FindItemByColumn(SPContext.Current.Site, libraryList, WBColumn.RecordID, recordIDString);

                if (recordItem != null)
                {
                    itemIDString = recordItem.ID.ToString();
                    ItemID.Value = itemIDString;
                }
            }

            if (recordItem != null)
            {
                record = new WBDocument(recordItem);

                FunctionalArea.Text = record.FunctionalArea.Names();

                WBRecordsType recordsType = record.RecordsType;

                recordsType.Taxonomy = recordsTypesTaxonomy;

                RecordsType.Text = recordsType.FullPath.Replace("/", " / ");


                if (!IsPostBack)
                {
                    Filename.Text = recordItem.Name;
                    Title.Text    = recordItem.Title;
                    RecordID.Text = record[WBColumn.RecordID].WBxToString();

                    LiveOrArchived.DataSource = new String[] { "Live", "Archived" };
                    LiveOrArchived.DataBind();
                    LiveOrArchived.SelectedValue = record[WBColumn.LiveOrArchived].WBxToString();

                    ProtectiveZone.DataSource = WBRecordsType.getProtectiveZones();
                    ProtectiveZone.DataBind();
                    ProtectiveZone.SelectedValue = record.ProtectiveZone;

                    subjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTags, WBColumn.SubjectTags.DisplayName, true);
                    SubjectTags.Text = record.SubjectTags.UIControlValue;
                }
            }

            if (!IsPostBack)
            {
                libraryWeb.Dispose();
                librarySite.Dispose();

                LiveOrArchived.Focus();
            }
        }
예제 #11
0
        private void RenderPage()
        {
            WBTaxonomy subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(SPContext.Current.Site);

            subjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTagsField, WorkBox.COLUMN_NAME__SUBJECT_TAGS, true);

            if (!String.IsNullOrEmpty(newSubjectTagsUIControlValue))
            {
                SubjectTagsField.Text = newSubjectTagsUIControlValue;
            }

            EditDocumentsTable.Controls.Clear();

            List <String> documentsDetailsList = new List <String>();

            string currentDetails = DocumentsDetails.Value.WBxTrim();

            WBLogging.Debug("Building the table with current details: " + currentDetails);

            if (!String.IsNullOrEmpty(currentDetails))
            {
                documentsDetailsList = new List <String>(currentDetails.Split(';'));
            }

            numOfDocs = documentsDetailsList.Count;

            Table table = new Table();

            table.Width = Unit.Percentage(100);

            TableRow headers = new TableRow();

            headers.WBxAddTableHeaderCell("Title");
            headers.WBxAddTableHeaderCell("Filename");
            headers.WBxAddTableHeaderCell("File Type");
            //            headers.WBxAddTableHeaderCell("Else");

            table.Rows.Add(headers);

            String recordsLibraryURL = WBFWebPartsUtils.GetRecordsLibraryURL(SPContext.Current.Site);

            using (SPSite site = new SPSite(recordsLibraryURL))
                using (SPWeb web = site.OpenWeb())
                {
                    SPList library = web.GetList(recordsLibraryURL);



                    int index = 0;
                    foreach (String details in documentsDetailsList)
                    {
                        TableRow row = CreateEditableTableRow(site, web, library, index, details);

                        allRows.Add(row);

                        table.Rows.Add(row);
                        index++;
                    }


                    if (extranetRecordsWeb != null)
                    {
                        extranetRecordsWeb.Dispose();
                    }
                    if (extranetRecordsSite != null)
                    {
                        extranetRecordsSite.Dispose();
                    }
                }
            EditDocumentsTable.Controls.Add(table);
        }