示例#1
0
        public static string GetContentCommands(string administratorName, PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo, string pageUrl, string currentFileName, bool isCheckPage)
        {
            var iconUrl   = SiteServerAssets.GetIconUrl(string.Empty);
            var modelType = EContentModelTypeUtils.GetEnumType(nodeInfo.ContentModelId);

            var builder = new StringBuilder();

            //添加内容
            if (!isCheckPage && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentAdd) && nodeInfo.Additional.IsContentAddable)
            {
                var redirectUrl = GetContentAddAddUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo, pageUrl);
                var title       = "添加内容";
                if (modelType == EContentModelType.GovPublic)
                {
                    title = "采集信息";
                }
                else if (modelType == EContentModelType.GovInteract)
                {
                    title = "新增办件";
                }
                else if (modelType == EContentModelType.Photo)
                {
                    title = "添加图片";
                }
                else if (modelType == EContentModelType.Vote)
                {
                    title = "发起投票";
                }

                builder.Append(
                    $@"<a href=""{redirectUrl}""><img style=""margin-right: 3px"" src=""{iconUrl}/add.gif"" align=""absMiddle"" />{title}</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");

                builder.Append($@"<a href=""javascript:;"" onclick=""{ModalContentImport.GetOpenWindowString(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导入内容</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");

                if (modelType != EContentModelType.UserDefined && modelType != EContentModelType.Vote && modelType != EContentModelType.Job && modelType != EContentModelType.GovInteract)
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalUploadWord.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, StringUtils.ValueToUrl(pageUrl))}"">导入Word</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }
            //删 除
            if (nodeInfo.ContentNum > 0 && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentDelete))
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{PageContentDelete.GetRedirectClickStringForSingleChannel(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, false, pageUrl)}"">删 除</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
            }

            if (nodeInfo.ContentNum > 0)
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{ModalContentExport.GetOpenWindowString(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导 出</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                //设置
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentAttributes.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置属性</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalAddToGroup.GetOpenWindowStringToContent(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置内容组</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //转 移
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate))
                {
                    var redirectUrl = PageContentTranslate.GetRedirectUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl);

                    var clickString = PageUtils.GetRedirectStringWithCheckBoxValue(redirectUrl, "ContentIDCollection", "ContentIDCollection", "请选择需要转移的内容!");

                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{clickString}"">转 移</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //排 序
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentTaxis.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">排 序</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //整理
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentOrder))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentTidyUp.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">整 理</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //审 核
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentCheck))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentCheck.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">审 核</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //归 档
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentArchive))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentArchive.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">归 档</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //跨站转发
                if (CrossSiteTransUtility.IsTranslatable(publishmentSystemInfo, nodeInfo))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentCrossSiteTrans.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">跨站转发</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //生 成
                if (!isCheckPage && (AdminUtility.HasWebsitePermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, AppManager.Cms.Permission.WebSite.Create) || AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.CreatePage)))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{Cms.ModalProgressBar
                            .GetOpenWindowStringWithCreateContentsOneByOne(publishmentSystemInfo.PublishmentSystemId,
                                nodeInfo.NodeId)}"">生 成</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }

            //选择显示项
            //if (nodeInfo.NodeType != ENodeType.BackgroundImageNode)
            //{
            if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ChannelEdit))
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{ModalSelectColumns.GetOpenWindowStringToContent(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, true)}"">显示项</a> &nbsp; &nbsp; ");
            }
            //}

            if (!isCheckPage && nodeInfo.ContentNum > 0)
            {
                if (builder.Length > 0)
                {
                    builder.Length = builder.Length - 15;
                }

                //builder.Append(GetContentLinks(publishmentSystemInfo, nodeInfo, contentType, currentFileName));

                builder.Append(
                    $@"&nbsp; <a href=""javascript:;;"" onClick=""$('#contentSearch').toggle(); return false""><img src=""{iconUrl}/search.gif"" align=""absMiddle"" alt=""快速查找"" /></a>");
            }


            //if (builder.Length > 0)
            //{
            //    builder.Length = builder.Length - 16;
            //}
            return(builder.ToString());
        }
示例#2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID");
            nodeID = TranslateUtils.ToInt(Request.QueryString["NodeID"]);

            isPermissionReply = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractReply);
            isPermissionEdit  = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractEdit);

            if (Body.IsQueryExists("Delete"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                if (arraylist.Count > 0)
                {
                    try
                    {
                        DataProvider.ContentDao.DeleteContents(PublishmentSystemId, PublishmentSystemInfo.AuxiliaryTableForGovInteract, arraylist, nodeID);
                        Body.AddSiteLog(PublishmentSystemId, "删除申请", Body.AdministratorName);
                        SuccessMessage("删除成功!");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "删除失败!");
                    }
                }
            }
            else if (Body.IsQueryExists("Accept"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var contentId in arraylist)
                {
                    var contentInfo = DataProvider.GovInteractContentDao.GetContentInfo(PublishmentSystemInfo, contentId);
                    if (contentInfo.State == EGovInteractState.New || contentInfo.State == EGovInteractState.Denied)
                    {
                        GovInteractApplyManager.Log(PublishmentSystemId, contentInfo.NodeId, contentInfo.Id, EGovInteractLogType.Accept, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovInteractContentDao.UpdateState(PublishmentSystemInfo, contentInfo.Id, EGovInteractState.Accepted);
                    }
                }
                SuccessMessage("受理申请成功!");
            }
            else if (Body.IsQueryExists("Deny"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var contentId in arraylist)
                {
                    var contentInfo = DataProvider.GovInteractContentDao.GetContentInfo(PublishmentSystemInfo, contentId);
                    if (contentInfo.State == EGovInteractState.New || contentInfo.State == EGovInteractState.Accepted)
                    {
                        GovInteractApplyManager.Log(PublishmentSystemId, contentInfo.NodeId, contentInfo.Id, EGovInteractLogType.Deny, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovInteractContentDao.UpdateState(PublishmentSystemInfo, contentId, EGovInteractState.Denied);
                    }
                }
                SuccessMessage("拒绝受理申请成功!");
            }
            else if (Body.IsQueryExists("Check"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var contentId in arraylist)
                {
                    var contentInfo = DataProvider.GovInteractContentDao.GetContentInfo(PublishmentSystemInfo, contentId);
                    if (contentInfo.State == EGovInteractState.Replied)
                    {
                        GovInteractApplyManager.Log(PublishmentSystemId, contentInfo.NodeId, contentInfo.Id, EGovInteractLogType.Check, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovInteractContentDao.UpdateState(PublishmentSystemInfo, contentId, EGovInteractState.Checked);
                    }
                }
                SuccessMessage("审核申请成功!");
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = PublishmentSystemInfo.Additional.PageSize;
            spContents.SelectCommand     = GetSelectString();
            spContents.SortField         = ContentAttribute.Taxis;
            spContents.SortMode          = GetSortMode();
            rptContents.ItemDataBound   += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                spContents.DataBind();
                ltlTotalCount.Text = spContents.TotalCount.ToString();

                if (phAccept != null)
                {
                    phAccept.Visible = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractAccept);
                    if (hlAccept != null)
                    {
                        hlAccept.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Accept=True", "IDCollection", "IDCollection", "请选择需要受理的申请!", "此操作将受理所选申请,确定吗?"));
                    }
                    if (hlDeny != null)
                    {
                        hlDeny.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Deny=True", "IDCollection", "IDCollection", "请选择需要拒绝的申请!", "此操作将拒绝受理所选申请,确定吗?"));
                    }
                }
                if (phCheck != null)
                {
                    phCheck.Visible = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractCheck);
                    if (hlCheck != null)
                    {
                        hlCheck.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Check=True", "IDCollection", "IDCollection", "请选择需要审核的申请!", "此操作将审核所选申请,确定吗?"));
                    }
                    if (hlRedo != null)
                    {
                        hlRedo.Attributes.Add("onclick", ModalGovInteractApplyRedo.GetOpenWindowString(PublishmentSystemId));
                    }
                }
                if (phSwitchToTranslate != null)
                {
                    phSwitchToTranslate.Visible = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractSwitchToTranslate);
                    if (hlSwitchTo != null)
                    {
                        hlSwitchTo.Attributes.Add("onclick", ModalGovInteractApplySwitchTo.GetOpenWindowString(PublishmentSystemId, nodeID));
                    }
                    if (hlTranslate != null)
                    {
                        hlTranslate.Attributes.Add("onclick", ModalGovInteractApplyTranslate.GetOpenWindowString(PublishmentSystemId, nodeID));
                    }
                }
                if (phComment != null)
                {
                    phComment.Visible = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractComment);
                    hlComment.Attributes.Add("onclick", ModalGovInteractApplyComment.GetOpenWindowString(PublishmentSystemId));
                }
                if (phDelete != null)
                {
                    phDelete.Visible = GovInteractManager.IsPermission(PublishmentSystemId, nodeID, AppManager.Wcm.Permission.GovInteract.GovInteractDelete) && PublishmentSystemInfo.Additional.GovInteractApplyIsDeleteAllowed;
                    hlDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Delete=True", "IDCollection", "IDCollection", "请选择需要删除的申请!", "此操作将删除所选申请,确定吗?"));
                }
                if (hlExport != null)
                {
                    hlExport.Attributes.Add("onclick", ModalContentExport.GetOpenWindowString(PublishmentSystemId, nodeID));
                }
            }
        }