예제 #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (CurrentPerson == null || CurrentPerson.PersonID == -1)
            {
                throw new ArenaApplicationException("SpeedDialer module requires that a user be logged in.  Please configure security so that only 'registered' users have access to this page.");
            }

            if (CurrentPerson.Peers.Count > 0)
            {
                string phoneTagName = CurrentOrganization.Settings["PBXPersonalListTagName"];
                if (phoneTagName != null)
                {
                    ProfileCollection personalTags = new ProfileCollection();
                    personalTags.LoadChildProfileHierarchy(-1, CurrentOrganization.OrganizationID, ProfileType.Personal, CurrentPerson.PersonID);
                    Arena.Core.Profile contactList = GetContactList(personalTags, phoneTagName.Trim().ToLower());

                    if (contactList != null)
                    {
                        lTagName.Text = contactList.Title;

                        extensionRules = new LookupType(SystemLookupType.PhoneInternalExtensionRules).Values;
                        PBXSystem      = PBXHelper.DefaultPBXSystem(CurrentOrganization);
                        manager        = PBXHelper.GetPBXClass(PBXSystem);

                        lvContacts.DataSource = contactList.Members;
                        lvContacts.DataBind();
                    }
                    else
                    {
                        this.Visible = false;
                    }
                }
                else
                {
                    this.Visible = false;
                }
            }
            else
            {
                this.Visible = false;
            }
        }
예제 #2
0
        protected Profile GetContactList(ProfileCollection profiles, string tagName)
        {
            foreach (Profile profile in profiles)
            {
                if (profile.Name.Trim().ToLower() == tagName)
                {
                    return(profile);
                }
            }

            foreach (Profile profile in profiles)
            {
                Arena.Core.Profile contactList = GetContactList(profile.ChildProfiles, tagName);
                if (contactList != null)
                {
                    return(contactList);
                }
            }

            return(null);
        }