コード例 #1
0
        /// <summary>
        /// Initialises the asset buttons control with the specified asset
        /// </summary>
        public void Initialise(Asset asset)
        {
            m_AssetId = asset.AssetId.GetValueOrDefault();

            // Get the URL to be used for the asset popup
            string showAssetInfoUrl = SiteUtils.GetShowAssetInfoUrl(m_AssetId);

            // Setup info button
            InfoHyperlink.Visible     = ShowButtons.IsSet(Buttons.Info);
            InfoHyperlink.NavigateUrl = showAssetInfoUrl;
            InfoHyperlink.ImageUrl    = SiteUtils.GetIconPath("info0.gif");

            // Setup download button
            DownloadHyperLink.Visible     = DisplayDownloadHyperlink(asset);
            DownloadHyperLink.NavigateUrl = AssetFileUrlHelper.GetDownloadUrl(m_AssetId);
            DownloadHyperLink.ImageUrl    = SiteUtils.GetIconPath("download0.gif");

            // Setup lightbox button
            AddToLightboxImageButton.Visible         = (ShowButtons.IsSet(Buttons.Lightbox));
            AddToLightboxImageButton.CommandArgument = m_AssetId.ToString();
            InitialiseLightboxButton(m_AssetId);

            // Setup cart button
            AddToCartImageButton.Visible         = (ShowButtons.IsSet(Buttons.Cart));
            AddToCartImageButton.CommandArgument = m_AssetId.ToString();
            InitialiseCartButton(m_AssetId);

            // Setup restricted icon
            RestrictedImageIcon.Visible  = (EntitySecurityManager.IsAssetRestricted(CurrentUser, asset) && ShowButtons.IsSet(Buttons.Restricted));
            RestrictedImageIcon.ImageUrl = SiteUtils.GetIconPath("restricted0.gif");
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (AssetWorkflowCommenter.IsNull)
                {
                    Response.Redirect("~/Admin/Assets/AssetList.aspx");
                }

                if (!StringUtils.IsBlank(AssetWorkflowCommenter.Comments))
                {
                    MessageLabel.SetErrorMessage("You have already commented on this workflow");
                    MessageLabel.Pinned = true;
                    DisableUI();
                }

                if (AssetWorkflow.IsComplete)
                {
                    MessageLabel.SetErrorMessage("Asset workflow is complete and comments have been disabled");
                    MessageLabel.Pinned = true;
                    DisableUI();
                }

                AssetWorkflowUserList.Repeater.DataSource = AssetWorkflow.AssetWorkflowUserList;
                AssetWorkflowUserList.Repeater.DataBind();

                Asset asset = AssetWorkflow.Asset;

                AssetReferenceLiteral.Text = asset.AssetId.ToString();
                UploadUserEmailHyperLink.SetNameEmail(asset.UploadedByUser.FullName, asset.UploadedByUser.Email);
                PublicationDateLiteral.Text        = asset.PublishDate.ToString(Global.DateFormat);
                DownloadAssetHyperLink.NavigateUrl = AssetFileUrlHelper.GetDownloadUrl(asset.AssetId);
                AssetThumbnail.Initialise(asset);
                AssetButtons1.Initialise(asset);
                AssetTypeCell.InnerText           = asset.AssetType.Name;
                BrandCell.InnerText               = asset.BrandName;
                ShortDescriptionCell.InnerHtml    = SiteUtils.ConvertTextToHtml(asset.Description);
                UsageRestrictionsCell.InnerText   = asset.UsageRestrictions;
                InvitingUserName.Text             = AssetWorkflowCommenter.InvitingUser.FullName;
                InvitingUserMessageCell.InnerText = AssetWorkflowCommenter.InvitingUserMessage;
                ResponseTextArea.Text             = AssetWorkflowCommenter.Comments;

                SiteUtils.SetHyperLink("Assets.AssetForm", string.Format("?assetId={0}", asset.AssetId), EditAssetHyperLink);

                AssetWorkflowLog.Bind(AssetWorkflow.Asset);
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ApproveRadioButton.Attributes.Add("onClick", "checkRadio()");
                RejectRadioButton.Attributes.Add("onClick", "checkRadio()");
                PendingRadioButton.Attributes.Add("onClick", "checkRadio()");
                InviteCommentsRadioButton.Attributes.Add("onClick", "checkRadio()");

                if (AssetWorkflowUser.IsNull)
                {
                    Response.Redirect("~/Admin/Assets/AssetList.aspx");
                }

                if (AssetWorkflow.IsComplete)
                {
                    MessageLabel.SetErrorMessage("Asset workflow is complete and comments have been disabled");
                    MessageLabel.Pinned = true;
                    DisableUI();
                }
                else
                {
                    if (AssetWorkflowUser.AssetWorkflowUserStatus == AssetWorkflowUserStatus.Waiting)
                    {
                        MessageLabel.SetErrorMessage("You do not have permission to action this workflow yet");
                        MessageLabel.Pinned = true;
                        DisableUI();
                    }
                    else if (AssetWorkflowUser.AssetWorkflowUserStatus != AssetWorkflowUserStatus.Pending)
                    {
                        MessageLabel.SetErrorMessage("You have already actioned this workflow");
                        MessageLabel.Pinned = true;
                        DisableUI();
                    }
                }

                AssetWorkflowUserList.Repeater.DataSource = AssetWorkflow.AssetWorkflowUserList;
                AssetWorkflowUserList.Repeater.DataBind();

                Asset asset = AssetWorkflow.Asset;

                AssetReferenceLiteral.Text = asset.AssetId.ToString();
                UploadUserEmailHyperLink.SetNameEmail(asset.UploadedByUser.FullName, asset.UploadedByUser.Email);
                PublicationDateLiteral.Text        = asset.PublishDate.ToString(Global.DateFormat);
                DownloadAssetHyperLink.NavigateUrl = AssetFileUrlHelper.GetDownloadUrl(asset.AssetId);
                AssetThumbnail.Initialise(asset);
                AssetButtons1.Initialise(asset);
                AssetTypeCell.InnerText         = asset.AssetType.Name;
                BrandCell.InnerText             = asset.BrandName;
                ShortDescriptionCell.InnerHtml  = SiteUtils.ConvertTextToHtml(asset.Description);
                UsageRestrictionsCell.InnerText = asset.UsageRestrictions;
                ResponseTextArea.Text           = AssetWorkflowUser.Comments;

                SiteUtils.SetHyperLink("Assets.AssetForm", string.Format("?assetId={0}", asset.AssetId), EditAssetHyperLink);

                switch (AssetWorkflowUser.AssetWorkflowUserStatus)
                {
                case (AssetWorkflowUserStatus.Pending):

                    PendingRadioButton.Checked = true;
                    break;

                case (AssetWorkflowUserStatus.Approved):

                    ApproveRadioButton.Checked = true;
                    break;

                case (AssetWorkflowUserStatus.Rejected):

                    RejectRadioButton.Checked = true;
                    break;
                }

                AssetWorkflowLog.Bind(asset);
            }
        }