protected void Page_Load(object sender, EventArgs e)
    {
        CurrentMaster.PanelContent.RemoveCssClass("dialog-content");

        // Set title
        PageTitle.TitleText = GetString("om.contact.collision");
        // Validate hash
        Regex re = RegexHelper.GetRegex(@"[\w\d_$$]*");
        mIdentifier = QueryHelper.GetString("params", "");
        if (!QueryHelper.ValidateHash("hash") || !re.IsMatch(mIdentifier))
        {
            pnlContent.Visible = false;
            return;
        }

        // Load dialog parameters
        Hashtable parameters = (Hashtable)WindowHelper.GetItem(mIdentifier);
        if (parameters != null)
        {
            mMergedContacts = (DataSet)parameters["MergedContacts"];
            mParentContact = (ContactInfo)parameters["ParentContact"];

            if (!mParentContact.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser))
            {
                RedirectToAccessDenied(mParentContact.TypeInfo.ModuleName, "Read");
            }

            mIsSitemanager = ValidationHelper.GetBoolean(parameters["issitemanager"], false);

            if (mIsSitemanager)
            {
                mStamp = SettingsKeyInfoProvider.GetValue("CMSCMStamp");
            }
            else
            {
                mStamp = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSCMStamp");
            }
            mStamp = MacroResolver.Resolve(mStamp);

            if (mParentContact != null)
            {
                // Check permissions
                ContactHelper.AuthorizedReadContact(mParentContact.ContactSiteID, true);

                // Load data
                Initialize();
                LoadContactCollisions();
                LoadContactGroups();
                LoadCustomFields();

                // Init controls
                btnMerge.Click += new EventHandler(btnMerge_Click);
                btnStamp.OnClientClick = "AddStamp('" + htmlNotes.CurrentEditor.ClientID + "'); return false;";
                ScriptHelper.RegisterTooltip(Page);
                RegisterScripts();

                // Set tabs
                tabFields.HeaderText = GetString("om.contact.fields");
                tabContacts.HeaderText = GetString("om.account.list");
                tabContactGroups.HeaderText = GetString("om.contactgroup.list");
                tabCustomFields.HeaderText = GetString("general.customfields");
            }
        }

        // User relative messages placeholder so that JQueryTab isn't moved a bit
        MessagesPlaceHolder.UseRelativePlaceHolder = false;

        // Do not let the editor overflow dialog window
        htmlNotes.SetValue("width", "520");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrentMaster.PanelContent.RemoveCssClass("dialog-content");

        // Set title
        PageTitle.TitleText = GetString("om.contact.collision");
        // Validate hash
        Regex re = RegexHelper.GetRegex(@"[\w\d_$$]*");

        mIdentifier = QueryHelper.GetString("params", "");
        if (!QueryHelper.ValidateHash("hash") || !re.IsMatch(mIdentifier))
        {
            pnlContent.Visible = false;
            return;
        }

        // Load dialog parameters
        Hashtable parameters = (Hashtable)WindowHelper.GetItem(mIdentifier);

        if (parameters != null)
        {
            mMergedContacts = (DataSet)parameters["MergedContacts"];
            mParentContact  = (ContactInfo)parameters["ParentContact"];

            if (!mParentContact.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser))
            {
                RedirectToAccessDenied(mParentContact.TypeInfo.ModuleName, "Read");
            }

            mIsSitemanager = ValidationHelper.GetBoolean(parameters["issitemanager"], false);

            if (mIsSitemanager)
            {
                mStamp = SettingsKeyInfoProvider.GetValue("CMSCMStamp");
            }
            else
            {
                mStamp = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSCMStamp");
            }
            mStamp = MacroResolver.Resolve(mStamp);

            if (mParentContact != null)
            {
                // Check permissions
                ContactHelper.AuthorizedReadContact(mParentContact.ContactSiteID, true);

                // Load data
                Initialize();
                LoadContactCollisions();
                LoadContactGroups();
                LoadCustomFields();

                // Init controls
                btnMerge.Click        += new EventHandler(btnMerge_Click);
                btnStamp.OnClientClick = "AddStamp('" + htmlNotes.CurrentEditor.ClientID + "'); return false;";
                ScriptHelper.RegisterTooltip(Page);
                RegisterScripts();

                // Set tabs
                tabFields.HeaderText        = GetString("om.contact.fields");
                tabContacts.HeaderText      = GetString("om.account.list");
                tabContactGroups.HeaderText = GetString("om.contactgroup.list");
                tabCustomFields.HeaderText  = GetString("general.customfields");
            }
        }

        // User relative messages placeholder so that JQueryTab isn't moved a bit
        MessagesPlaceHolder.UseRelativePlaceHolder = false;

        // Do not let the editor overflow dialog window
        htmlNotes.SetValue("width", "520");
    }