/// <summary>
    /// Loads the site DropDownLists.
    /// </summary>
    private void LoadSites()
    {
        // Define special fields
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition(null, FieldInfo, ContextResolver);

        specialFields.Add(new SpecialField {
            Text = GetString("general.selectall"), Value = "##all##"
        });
        specialFields.Add(new SpecialField {
            Text = GetString("dialogs.config.currentsite"), Value = "##current##"
        });

        // Set site selector
        siteSelectorContent.DropDownSingleSelect.AutoPostBack = true;
        siteSelectorContent.AllowAll = false;
        siteSelectorContent.UseCodeNameForSelection   = true;
        siteSelectorContent.UniSelector.SpecialFields = specialFields;

        siteSelectorMedia.DropDownSingleSelect.AutoPostBack = true;
        siteSelectorMedia.AllowAll = false;
        siteSelectorMedia.UseCodeNameForSelection   = true;
        siteSelectorMedia.UniSelector.SpecialFields = specialFields;

        if (mediaLoaded)
        {
            siteSelectorMedia.UniSelector.OnSelectionChanged += UniSelectorMediaSites_OnSelectionChanged;
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Page load event.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (StopProcessing)
        {
            uniselect.StopProcessing = true;
            return;
        }

        var specialFields = new SpecialFieldsDefinition(null, FieldInfo, ContextResolver);

        if (ShowDefaultItem)
        {
            specialFields.Add(new SpecialField {
                Text = GetString("WebPartPropertise.Default"), Value = "|default|"
            });
        }

        if (ShowNewItem)
        {
            specialFields.Add(new SpecialField {
                Text = GetString("WebPartPropertise.New"), Value = "|new|"
            });
        }

        uniselect.SpecialFields = specialFields;
        uniselect.DropDownSingleSelect.AutoPostBack = true;
        uniselect.IsLiveSite = IsLiveSite;
    }
    /// <summary>
    /// Prepares new field.
    /// </summary>
    /// <param name="controlName">Code name of used control</param>
    private FormFieldInfo PrepareNewField(string controlName)
    {
        FormFieldInfo ffi = new FormFieldInfo();

        string[] controlDefaultDataType = FormUserControlInfoProvider.GetUserControlDefaultDataType(controlName);
        ffi.DataType  = controlDefaultDataType[0];
        ffi.Size      = ValidationHelper.GetInteger(controlDefaultDataType[1], 0);
        ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;

        FormUserControlInfo control = FormUserControlInfoProvider.GetFormUserControlInfo(controlName);

        if (control != null)
        {
            ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, control.UserControlDisplayName);
        }

        ffi.AllowEmpty              = true;
        ffi.PublicField             = true;
        ffi.Name                    = GetUniqueFieldName(controlName);
        ffi.Settings["controlname"] = controlName;

        // For list controls create three default options
        if (FormHelper.HasListControl(ffi))
        {
            SpecialFieldsDefinition optionDefinition = new SpecialFieldsDefinition();

            for (int i = 1; i <= 3; i++)
            {
                optionDefinition.Add(new SpecialField
                {
                    Value = OptionsDesigner.DEFAULT_OPTION + i,
                    Text  = OptionsDesigner.DEFAULT_OPTION + i
                });
            }

            ffi.Settings["Options"] = optionDefinition.ToString();
        }

        if (controlName.EqualsCSafe("CalendarControl"))
        {
            ffi.Settings["EditTime"] = false;
        }

        return(ffi);
    }
    /// <summary>
    /// Init UniSelectors for selecting controls.
    /// </summary>
    private void InitControlSelectors()
    {
        var detailsControlSelector = (UniSelector)EditForm.FieldControls["activitytypedetailformcontrol"];
        var mainControlSelector = (UniSelector)EditForm.FieldControls["activitytypemainformcontrol"];

        // Add additional item for selecting default control - currently used only for 'Custom Activity'
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition();
        specialFields.Add(new SpecialField()
        {
            Text = GetString("general.defaultchoice"),
            Value = "##default##"
        });

        detailsControlSelector.SpecialFields = mainControlSelector.SpecialFields = specialFields;

        // Set (None) values to save to database
        detailsControlSelector.NoneRecordValue = "";
        mainControlSelector.NoneRecordValue = "";
    }
Exemplo n.º 5
0
    /// <summary>
    /// Init UniSelectors for selecting controls.
    /// </summary>
    private void InitControlSelectors()
    {
        var detailsControlSelector = (UniSelector)EditForm.FieldControls["activitytypedetailformcontrol"];
        var mainControlSelector    = (UniSelector)EditForm.FieldControls["activitytypemainformcontrol"];

        // Add additional item for selecting default control - currently used only for 'Custom Activity'
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition();

        specialFields.Add(new SpecialField()
        {
            Text  = GetString("general.defaultchoice"),
            Value = "##default##"
        });

        detailsControlSelector.SpecialFields = mainControlSelector.SpecialFields = specialFields;

        // Set (None) values to save to database
        detailsControlSelector.NoneRecordValue = "";
        mainControlSelector.NoneRecordValue    = "";
    }
    /// <summary>
    /// Page load event.
    /// </summary>    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (StopProcessing)
        {
            uniselect.StopProcessing = true;
            return;
        }

        var specialFields = new SpecialFieldsDefinition(null, FieldInfo, ContextResolver);

        if (ShowDefaultItem)
        {
            specialFields.Add(new SpecialField { Text = GetString("WebPartPropertise.Default"), Value = "|default|" });
        }

        if (ShowNewItem)
        {
            specialFields.Add(new SpecialField { Text = GetString("WebPartPropertise.New"), Value = "|new|" });
        }

        uniselect.SpecialFields = specialFields;
        uniselect.DropDownSingleSelect.AutoPostBack = true;
        uniselect.IsLiveSite = IsLiveSite;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.WebAnalytics);
        }

        // If deletion is in progress
        if (StatisticsInfoProvider.DataDeleterIsRunning)
        {
            timeRefresh.Enabled = true;
            ViewState["DeleterStarted"] = true;
            EnableControls(false);
            ReloadInfoPanel();
        }
        // If deletion has just end - add close script
        else if (ValidationHelper.GetBoolean(ViewState["DeleterStarted"], false))
        {
            ScriptHelper.RegisterStartupScript(this, typeof(string), "CloseScript", ScriptHelper.GetScript("wopener.RefreshPage(); CloseDialog();"));
        }

        // Configure dynamic selectors
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition();
        specialFields.Add(new SpecialField
        {
            Text = GetString("general.pleaseselect"),
            Value = ""
        });

        usCampaigns.UniSelector.SpecialFields = specialFields;
        ucConversions.UniSelector.SpecialFields = specialFields;

        if (!RequestHelper.IsPostBack())
        {
            usCampaigns.Value = "";
            ucConversions.Value = "";
        }

        string title = GetString("AnayticsManageData.ManageData");
        Page.Title = title;
        PageTitle.TitleText = title;
        // Confirmation message for deleting
        string deleteFromToMessage = ScriptHelper.GetString(GetString("webanal.deletefromtomsg"));
        deleteFromToMessage = deleteFromToMessage.Replace("##FROM##", "' + elemFromStr + '");
        deleteFromToMessage = deleteFromToMessage.Replace("##TO##", "' + elemToStr + '");

        string script =
            " var elemTo = document.getElementById('" + pickerTo.ClientID + "_txtDateTime'); " +
            " var elemFrom = document.getElementById('" + pickerFrom.ClientID + "_txtDateTime'); " +
            " var elemToStr = " + ScriptHelper.GetString(GetString("webanal.now")) + "; " +
            " var elemFromStr = " + ScriptHelper.GetString(GetString("webanal.beginning")) + "; " +
            " var deleteAll = 1; " +
            " if (elemTo.value != '') { deleteAll = 0; elemToStr = elemTo.value; }; " +
            " if (elemFrom.value != '') { deleteAll = 0; elemFromStr = elemFrom.value; }; " +
            " if (deleteAll == 1) { return confirm(" + ScriptHelper.GetString(GetString("webanal.deleteall")) + "); } " +
            " else { return confirm(" + deleteFromToMessage + "); }; ";
        btnDelete.OnClientClick = script + ";  return false;";

        statCodeName = QueryHelper.GetString("statCodeName", String.Empty);

        switch (statCodeName)
        {
            case "campaigns":
                pnlCampaigns.Visible = true;
                break;

            case "conversion":
                pnlConversions.Visible = true;
                break;
        }
    }
    /// <summary>
    /// Loads the site DropDownLists.
    /// </summary>
    private void LoadSites()
    {
        // Define special fields
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition(null, FieldInfo, ContextResolver);
        specialFields.Add(new SpecialField { Text = GetString("general.selectall"), Value = "##all##" });
        specialFields.Add(new SpecialField { Text = GetString("dialogs.config.currentsite"), Value = "##current##" });

        // Set site selector
        siteSelectorContent.DropDownSingleSelect.AutoPostBack = true;
        siteSelectorContent.AllowAll = false;
        siteSelectorContent.UseCodeNameForSelection = true;
        siteSelectorContent.UniSelector.SpecialFields = specialFields;

        siteSelectorMedia.DropDownSingleSelect.AutoPostBack = true;
        siteSelectorMedia.AllowAll = false;
        siteSelectorMedia.UseCodeNameForSelection = true;
        siteSelectorMedia.UniSelector.SpecialFields = specialFields;

        if (mediaLoaded)
        {
            siteSelectorMedia.UniSelector.OnSelectionChanged += UniSelectorMediaSites_OnSelectionChanged;
        }
    }
    /// <summary>
    /// Prepares new field.
    /// </summary>
    /// <param name="controlName">Code name of used control</param>
    private FormFieldInfo PrepareNewField(string controlName)
    {
        FormFieldInfo ffi = new FormFieldInfo();

        string[] controlDefaultDataType = FormUserControlInfoProvider.GetUserControlDefaultDataType(controlName);
        ffi.DataType = controlDefaultDataType[0];
        ffi.Size = ValidationHelper.GetInteger(controlDefaultDataType[1], 0);
        ffi.FieldType = FormFieldControlTypeEnum.CustomUserControl;

        FormUserControlInfo control = FormUserControlInfoProvider.GetFormUserControlInfo(controlName);
        if (control != null)
        {
            ffi.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, control.UserControlDisplayName);
        }

        ffi.AllowEmpty = true;
        ffi.PublicField = true;
        ffi.Name = GetUniqueFieldName(controlName);
        ffi.Settings["controlname"] = controlName;

        // For list controls create three default options
        if (FormHelper.HasListControl(ffi))
        {
            SpecialFieldsDefinition optionDefinition = new SpecialFieldsDefinition();

            for (int i = 1; i <= 3; i++)
            {
                optionDefinition.Add(new SpecialField
                {
                    Value = OptionsDesigner.DEFAULT_OPTION + i,
                    Text = OptionsDesigner.DEFAULT_OPTION + i
                });
            }

            ffi.Settings["Options"] = optionDefinition.ToString();
        }

        if (controlName.EqualsCSafe("CalendarControl"))
        {
            ffi.Settings["EditTime"] = false;
        }

        return ffi;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.WebAnalytics);
        }

        // If deletion is in progress
        if (StatisticsInfoProvider.DataDeleterIsRunning)
        {
            timeRefresh.Enabled         = true;
            ViewState["DeleterStarted"] = true;
            EnableControls(false);
            ReloadInfoPanel();
        }
        // If deletion has just end - add close script
        else if (ValidationHelper.GetBoolean(ViewState["DeleterStarted"], false))
        {
            ScriptHelper.RegisterStartupScript(this, typeof(string), "CloseScript", ScriptHelper.GetScript("wopener.RefreshPage(); CloseDialog();"));
        }

        // Configure dynamic selectors
        SpecialFieldsDefinition specialFields = new SpecialFieldsDefinition();

        specialFields.Add(new SpecialField
        {
            Text  = GetString("general.pleaseselect"),
            Value = ""
        });

        usCampaigns.UniSelector.SpecialFields   = specialFields;
        ucConversions.UniSelector.SpecialFields = specialFields;

        if (!RequestHelper.IsPostBack())
        {
            usCampaigns.Value   = "";
            ucConversions.Value = "";
        }

        string title = GetString("AnayticsManageData.ManageData");

        Page.Title          = title;
        PageTitle.TitleText = title;
        // Confirmation message for deleting
        string deleteFromToMessage = ScriptHelper.GetString(GetString("webanal.deletefromtomsg"));

        deleteFromToMessage = deleteFromToMessage.Replace("##FROM##", "' + elemFromStr + '");
        deleteFromToMessage = deleteFromToMessage.Replace("##TO##", "' + elemToStr + '");

        string script =
            " var elemTo = document.getElementById('" + pickerTo.ClientID + "_txtDateTime'); " +
            " var elemFrom = document.getElementById('" + pickerFrom.ClientID + "_txtDateTime'); " +
            " var elemToStr = " + ScriptHelper.GetString(GetString("webanal.now")) + "; " +
            " var elemFromStr = " + ScriptHelper.GetString(GetString("webanal.beginning")) + "; " +
            " var deleteAll = 1; " +
            " if (elemTo.value != '') { deleteAll = 0; elemToStr = elemTo.value; }; " +
            " if (elemFrom.value != '') { deleteAll = 0; elemFromStr = elemFrom.value; }; " +
            " if (deleteAll == 1) { return confirm(" + ScriptHelper.GetString(GetString("webanal.deleteall")) + "); } " +
            " else { return confirm(" + deleteFromToMessage + "); }; ";

        btnDelete.OnClientClick = script + ";  return false;";

        statCodeName = QueryHelper.GetString("statCodeName", String.Empty);

        switch (statCodeName)
        {
        case "campaigns":
            pnlCampaigns.Visible = true;
            break;

        case "conversion":
            pnlConversions.Visible = true;
            break;
        }
    }