public void SetBreadcrumbs()
    {
        string bcUrl = null;

        if (QueryHelper.GetInteger("dialogmode", 0) != 1)
        {
            bcUrl = GetListingPageUrl();
        }

        SetBreadcrumb(0, GetString("ma.contact.pendingcontacts"), bcUrl, null, null);
        SetBreadcrumb(1, HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(AutomationManager.ObjectID)), null, null, null);
    }
    /// <summary>
    /// Breadcrumbs setting.
    /// </summary>
    private void SetBreadcrumbs()
    {
        string bcUrl = null;

        if (!IsDialog)
        {
            bcUrl = GetListingUrl();
        }

        SetBreadcrumb(0, GetString("ma.contact.pendingcontacts"), bcUrl, null, null);
        SetBreadcrumb(1, HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(autoMan.ObjectID)), null, null, null);
    }
Пример #3
0
    /// <summary>
    /// Loads data of specific activity.
    /// </summary>
    protected void LoadData()
    {
        if (activityId <= 0)
        {
            return;
        }

        // Load and check if object exists
        ActivityInfo ai = ActivityInfo.Provider.Get(activityId);

        EditedObject = ai;

        ActivityTypeInfo ati = ActivityTypeInfo.Provider.Get(ai.ActivityType);

        plcActivityValue.Visible = (ati == null) || ati.ActivityTypeIsCustom || (ati.ActivityTypeName == PredefinedActivityType.PAGE_VISIT) && !String.IsNullOrEmpty(ai.ActivityValue);

        string dispName = (ati != null ? ati.ActivityTypeDisplayName : GetString("general.na"));

        lblTypeVal.Text    = String.Format("{0}", HTMLHelper.HTMLEncode(dispName));
        lblContactVal.Text = HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(ai.ActivityContactID));

        // Init contact detail link
        string contactURL = ApplicationUrlHelper.GetElementDialogUrl(ModuleName.CONTACTMANAGEMENT, "EditContact", ai.ActivityContactID);

        btnContact.Attributes.Add("onClick", ScriptHelper.GetModalDialogScript(contactURL, "ContactDetail"));
        btnContact.ToolTip = GetString("general.edit");

        lblDateVal.Text = (ai.ActivityCreated == DateTimeHelper.ZERO_TIME ? GetString("general.na") : HTMLHelper.HTMLEncode(ai.ActivityCreated.ToString()));

        // Get site display name
        string siteName = SiteInfoProvider.GetSiteName(ai.ActivitySiteID);

        if (String.IsNullOrEmpty(siteName))
        {
            siteName = GetString("general.na");
        }
        else
        {
            // Retrieve site info and its display name
            SiteInfo si = SiteInfo.Provider.Get(siteName);
            if (si != null)
            {
                siteName = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(si.DisplayName));
            }
            else
            {
                siteName = GetString("general.na");
            }
        }
        lblSiteVal.Text = siteName;

        string url = ai.ActivityURL;

        plcCampaign.Visible = !String.IsNullOrEmpty(ai.ActivityCampaign);
        lblCampaignVal.Text = HTMLHelper.HTMLEncode(ai.ActivityCampaign);
        lblValue.Text       = HTMLHelper.HTMLEncode(String.IsNullOrEmpty(ai.ActivityValue) ? GetString("general.na") : ai.ActivityValue);

        // Init textboxes only for the first time
        if (!RequestHelper.IsPostBack())
        {
            txtComment.Value = ai.ActivityComment;
            txtTitle.Text    = ai.ActivityTitle;
            txtURLRef.Text   = ai.ActivityURLReferrer;
            if (ai.ActivityType != PredefinedActivityType.NEWSLETTER_CLICKTHROUGH)
            {
                txtURL.Text = url;
            }
        }

        cDetails.ActivityID = activityId;

        // Init link button URL
        if (ai.ActivitySiteID > 0)
        {
            SiteInfo si = SiteInfo.Provider.Get(ai.ActivitySiteID);
            if (si != null)
            {
                // Hide view button if URL is blank
                string activityUrl = ai.ActivityURL;
                if ((activityUrl != null) && !String.IsNullOrEmpty(activityUrl.Trim()))
                {
                    string appUrl = URLHelper.GetApplicationUrl(si.DomainName);
                    url                 = URLHelper.GetAbsoluteUrl(activityUrl, appUrl, appUrl, "");
                    url                 = URLHelper.AddParameterToUrl(url, URLHelper.SYSTEM_QUERY_PARAMETER, "1");
                    btnView.ToolTip     = GetString("general.view");
                    btnView.NavigateUrl = url;
                    btnView.Visible     = true;
                }
                else
                {
                    btnView.Visible = false;
                }
            }
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register script for unimenu button selection
        AddMenuButtonSelectScript(this, "Contacts", null, "menu");

        // Get current user info
        CurrentUserInfo user = CMSContext.CurrentUser;

        // Get contact info object
        ContactInfo ci = (ContactInfo)EditedObject;

        if (ci == null)
        {
            return;
        }

        // Check permission read
        ContactHelper.AuthorizedReadContact(ci.ContactSiteID, true);

        // Check if running under site manager (and distribute "site manager" flag to other tabs)
        string siteManagerParam = string.Empty;

        if (IsSiteManager)
        {
            siteManagerParam = "&issitemanager=1";
        }

        // Set default help topic
        SetHelp("onlinemarketing_contact_general", "helpTopic");

        // register scripts in modal dialog
        if (isDialogMode)
        {
            RegisterModalPageScripts();
        }

        string append = null;

        if (ci.ContactMergedWithContactID != 0)
        {
            // Append '(merged)' behind contact name in breadcrumbs
            append = " " + GetString("om.contact.mergedsuffix");
        }
        else if (ci.ContactSiteID == 0)
        {
            // Append '(global)' behind contact name in breadcrumbs
            append = " " + GetString("om.contact.globalsuffix");
        }

        // Modify header appearance in modal dialog (display title instead of breadcrumbs)
        if (QueryHelper.GetBoolean("dialogmode", false))
        {
            CurrentMaster.Title.TitleText  = GetString("om.contact.edit") + " - " + HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(ci)) + append;
            CurrentMaster.Title.TitleImage = GetImageUrl("Objects/OM_Contact/object.png");
        }
        else
        {
            // Get url for breadcrumbs
            string url = ResolveUrl("~/CMSModules/ContactManagement/Pages/Tools/Contact/List.aspx");
            url = URLHelper.AddParameterToUrl(url, "siteid", SiteID.ToString());
            if (IsSiteManager)
            {
                url = URLHelper.AddParameterToUrl(url, "issitemanager", "1");
            }

            CurrentPage.InitBreadcrumbs(2);
            CurrentPage.SetBreadcrumb(0, GetString("om.contact.list"), url, "_parent", null);
            CurrentPage.SetBreadcrumb(1, ContactInfoProvider.GetContactFullName(ci) + append, null, null, null);
        }

        // Check if contact has any custom fields
        int i = 0;

        FormInfo formInfo = FormHelper.GetFormInfo(ci.Generalized.DataClass.ClassName, false);

        if (formInfo.GetFormElements(true, false, true).Any())
        {
            i = 1;
        }

        int  contactId      = ci.ContactID;
        bool ipTabAvailable = ActivitySettingsHelper.IPLoggingEnabled(CMSContext.CurrentSiteName) || ContactHelper.IsSiteManager;
        int  counter        = 0;

        // Initialize tabs
        InitTabs("content");

        SetTab(counter++, GetString("general.general"), "Tab_General.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_general');");

        if (i > 0)
        {
            // Add tab for custom fields
            SetTab(counter++, GetString("general.customfields"), "Tab_CustomFields.aspx?contactid=" + ci.ContactID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_customfields');");
        }

        if (AccountHelper.AuthorizedReadAccount(ci.ContactSiteID, false) || ContactHelper.AuthorizedReadContact(ci.ContactSiteID, false))
        {
            SetTab(counter++, GetString("om.account.list"), "Tab_Accounts.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_accounts');");
        }

        SetTab(counter++, GetString("om.membership.list"), "Membership/Tab_Membership.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_membership');");

        SetTab(counter++, GetString("om.activity.list"), "Tab_Activities.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_activities');");

        if (ipTabAvailable)
        {
            SetTab(counter++, GetString("om.activity.iplist"), "Tab_IPs.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_ips');");
        }

        // Show contact groups
        SetTab(counter++, GetString("om.contactgroup.list"), "Tab_ContactGroups.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_contactgroups');");

        // Show scoring tab for site contacts
        if (ci.ContactSiteID > 0)
        {
            SetTab(counter++, GetString("om.score.list"), "Tab_Scoring.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_scoring');");
        }

        // Hide last 3 tabs if the contact is merged
        if (ci.ContactMergedWithContactID == 0)
        {
            SetTab(counter++, GetString("om.contact.merge"), "Tab_Merge.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_merge');");
        }

        // Data.com
        SetTab(counter++, "Data.com", "Tab_DataCom.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_datacom');");

        // Marketing automation
        if (WorkflowInfoProvider.IsMarketingAutomationAllowed())
        {
            string stateUrl = String.Format("{0}?objectid={1}{2}", "Tab_Processes.aspx", contactId, siteManagerParam);
            SetTab(counter++, GetString("ma.contact.processes"), stateUrl, "SetHelpTopic('helpTopic', 'automation_state_list');");
        }
    }
 public void SetBreadcrumbs()
 {
     SetBreadcrumb(0, GetString("ma.contact.contacts"), GetListingPageUrl(), null, null);
     SetBreadcrumb(1, HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(AutomationManager.ObjectID)), null, null, null);
 }