Exemple #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;
            }
        }