예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string currSiteName = null;

        // Get current site ID/name
        if (ContactHelper.IsSiteManager)
        {
            currSiteId   = SiteID;
            currSiteName = SiteInfoProvider.GetSiteName(currSiteId);
        }
        else
        {
            currSiteName = CMSContext.CurrentSiteName;
            currSiteId   = CMSContext.CurrentSiteID;
        }

        bool globalObjectsSelected = (currSiteId == UniSelector.US_GLOBAL_RECORD);
        bool allSitesSelected      = (currSiteId == UniSelector.US_ALL_RECORDS);

        // Show warning if activity logging is disabled (do not show anything if global objects or all sites is selected)
        if (!ActivitySettingsHelper.OnlineMarketingEnabled(currSiteName))
        {
            lblDis.ResourceString = "om.onlinemarketing.disabled";
        }
        pnlDis.Visible = !globalObjectsSelected && !allSitesSelected && !ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(currSiteName);

        // Initialize list and filter controls
        fltElem.SiteID  = currSiteId;
        listElem.SiteID = currSiteId;

        // Show site name column if activities of all sites are displayed
        listElem.ShowSiteNameColumn = allSitesSelected;
        fltElem.ShowSiteFilter      = allSitesSelected;

        fltElem.ShowIPFilter         = ActivitySettingsHelper.IPLoggingEnabled(currSiteName);
        listElem.ShowIPAddressColumn = fltElem.ShowIPFilter;

        listElem.OrderBy        = "ActivityCreated DESC";
        listElem.WhereCondition = fltElem.WhereCondition;

        if (QueryHelper.GetInteger("saved", 0) == 1)
        {
            lblInfo.Visible = true;
            lblInfo.Text    = GetString("general.changessaved");
        }

        // Set header actions (add button)
        string url = ResolveUrl("New.aspx?siteId=" + currSiteId);

        if (IsSiteManager)
        {
            url = URLHelper.AddParameterToUrl(url, "isSiteManager", "1");
        }
        string[,] actions  = new string[1, 8];
        actions[0, 0]      = "HyperLink";
        actions[0, 1]      = GetString("om.activity.newcustom");
        actions[0, 3]      = url;
        actions[0, 5]      = GetImageUrl("Objects/OM_Activity/add.png");
        hdrActions.Actions = actions;
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string currSiteName = null;
        int    currSiteId   = 0;

        // Get current site ID/name
        if (ContactHelper.IsSiteManager)
        {
            currSiteId   = this.SiteID;
            currSiteName = SiteInfoProvider.GetSiteName(currSiteId);
        }
        else
        {
            currSiteName = CMSContext.CurrentSiteName;
            currSiteId   = CMSContext.CurrentSiteID;
        }

        bool globalObjectsSelected = (currSiteId == UniSelector.US_GLOBAL_RECORD);
        bool allSitesSelected      = (currSiteId == UniSelector.US_ALL_RECORDS);

        // Show warning if activity logging is disabled (do not show anything if global objects or all sites is selected)
        if (!ActivitySettingsHelper.OnlineMarketingEnabled(currSiteName))
        {
            lblDis.ResourceString = "om.onlinemarketing.disabled";
        }
        pnlDis.Visible = !globalObjectsSelected && !allSitesSelected && !ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(currSiteName);

        CurrentMaster.HeaderActions.Actions[0, 3] = AddSiteQuery(CurrentMaster.HeaderActions.Actions[0, 3], QueryHelper.GetInteger("siteid", 0));
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (CMSPage.EditedObject != null)
        {
            ContactInfo ci = (ContactInfo)CMSPage.EditedObject;

            // Check permission
            this.CheckReadPermission(ci.ContactSiteID);

            bool isGlobal = (ci.ContactSiteID == 0);
            bool isMerged = (ci.ContactMergedWithContactID > 0);

            // Show warning if activity logging is disabled
            string siteName = SiteInfoProvider.GetSiteName(ci.ContactSiteID);
            if (!ActivitySettingsHelper.OnlineMarketingEnabled(siteName))
            {
                lblDis.ResourceString = "om.onlinemarketing.disabled";
            }
            pnlDis.Visible = !isGlobal && !ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteName);

            // Show IP addresses if enabled
            fltElem.ShowIPFilter         = ActivitySettingsHelper.IPLoggingEnabled(siteName);
            fltElem.ShowSiteFilter       = this.IsSiteManager && isGlobal;
            listElem.ShowIPAddressColumn = fltElem.ShowIPFilter;


            // Restrict WHERE condition for activities of current site (if not in site manager)
            if (!this.IsSiteManager)
            {
                fltElem.SiteID = CMSContext.CurrentSiteID;
            }

            listElem.ContactID       = ci.ContactID;
            listElem.IsMergedContact = isMerged;
            listElem.IsGlobalContact = isGlobal;

            fltElem.ShowContactSelector    = isGlobal;
            listElem.ShowContactNameColumn = isGlobal;
            listElem.ShowSiteNameColumn    = this.IsSiteManager && isGlobal;
            listElem.ShowRemoveButton      = !isMerged && !isGlobal;
            listElem.OrderBy        = "ActivityCreated DESC";
            listElem.WhereCondition = fltElem.WhereCondition;
        }
    }