<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/dashboard.master" AutoEventWireup="true" CodeBehind="Dashboard_My.aspx.cs" Inherits="helpdesk.helpdesk.Dashboard_My" %>

 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <style>
        #span_action a {
         color:#ffffff;
        }

         #span_action a:hover {
         color:#000000;
        }

        #span_action ul li a {
         color:#000;
        }
    </style>

  

      

      

  

    <div class="panel panel-default">
  <div class="panel-heading">问题搜索</div>
  <div class="panel-body">

     <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">

            <ContentTemplate>
                  
         ID <asp:TextBox ID="txt_tickid"  placeholder="ID"  CssClass="inline form-control" runat="server" Width=50px  ></asp:TextBox>
               
            &nbsp;&nbsp; 提交者<asp:TextBox ID="txt_username"   placeholder="提交者"  CssClass="inline form-control" Width="80px" runat="server"  ></asp:TextBox>  
                
             &nbsp;&nbsp;关键字<asp:TextBox ID="txt_key"  placeholder="问题关键字" CssClass="inline form-control" Width="110px"  runat="server"  ></asp:TextBox>
                 
                
          
          状态 <asp:DropDownList  CssClass="inline form-control" Width="100px"  OnSelectedIndexChanged="search" runat="server" ID="ddl_status" AppendDataBoundItems="true" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                    </asp:DropDownList>
       

        优先级 <asp:DropDownList CssClass="inline form-control" Width="100px"    OnSelectedIndexChanged="search" runat="server" ID="ddl_priority" AppendDataBoundItems="true" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                    </asp:DropDownList>
             
             
        关闭 <asp:DropDownList CssClass="inline form-control" Width="100px"   OnSelectedIndexChanged="search" runat="server" ID="ddl_isclose" AppendDataBoundItems="true" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                     <asp:ListItem Text="已关闭" Value="1"></asp:ListItem>
                       <asp:ListItem Text="未关闭" Value="0"></asp:ListItem>
                    </asp:DropDownList>
                    
                   
        大类 <asp:DropDownList CssClass="inline form-control" Width="160px"    OnSelectedIndexChanged="search"  runat="server" ID="ddl_cat1id" AppendDataBoundItems="true" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                    </asp:DropDownList>
                              
        
                          
       
               
    <asp:Button ID="Button1" runat="server" Text="搜索"   CssClass="btn btn-success btn-flat " 
             onclick="btn_search_Click"    />

           
          <a href="javascript:void(0);"  onclick='ept("Export_Data.aspx?types=alltickets")'  class="btn  btn-primary  btn-flat"> 导出</a> 
          
                  </ContentTemplate>
         </asp:UpdatePanel>
    
            
          
      </div>
        </div>


 
                     
        <div style="  padding:1px; background-color:#ed7d31; color:#ffffff">
            
         <a href="#" class="btn"  style="color:#ffffff">操作</a>
          
              <span id="span_action" style=" display:none   "> | 
               
                 <asp:UpdatePanel ID="UpdatePanel3" RenderMode="Inline" runat="server" UpdateMode="Conditional">
                     <ContentTemplate>
                
                  <asp:LinkButton ID="lb_del" class="btn"
                        OnClientClick="isselect();  return confirm('您确定要删除该Ticket吗?'); "
                         OnClick="btndelete_Click" runat="server">删除</asp:LinkButton>

       
             <asp:LinkButton ID="lb_solved_close" class="btn"
                        OnClientClick="isselect();"
                       OnClick="lb_solved_close_Click" runat="server">已解决并关闭</asp:LinkButton>       
                
                         | 
  
  <div class="btn-group">            
  <a data-toggle="dropdown" class="btn dropdown-toggle"      
        onclick=" return false;" >更改关闭  <span class="caret"></span> 
  </a>

  <ul class="dropdown-menu" role="menu">
   <li> <asp:LinkButton ID="lb_close" onclick="btnopenclose_Click"   class="opaction"     CommandArgument="close"   runat="server">关闭 close</asp:LinkButton></li>
   <li><asp:LinkButton ID="lbl_open" onclick="btnopenclose_Click"    class="opaction"  CommandArgument="open"   runat="server">开启 open</asp:LinkButton></li>
 </ul>
</div> 
                
                
           
      <div class="btn-group">            
  <a data-toggle="dropdown" class="btn dropdown-toggle"   style="color:#ffffff"  onclick=" return false;" >更改处理  <span class="caret"></span> </a>

  <ul class="dropdown-menu" role="menu">
   <li> <asp:LinkButton ID="lb_process_solved"   onclick="lb_process_click"  class="opaction"   CommandArgument="solved"   runat="server">已解决 solved</asp:LinkButton></li>
   <li><asp:LinkButton ID="lb_process_unsolved" onclick="lb_process_click"   class="opaction"   CommandArgument="unsolved"   runat="server">未解决 unsolved</asp:LinkButton></li>
   <li><asp:LinkButton ID="lb_process_pending" onclick="lb_process_click"    class="opaction"   CommandArgument="pending"   runat="server">暂停 pending</asp:LinkButton></li>

 </ul>
</div>      
                
           
                
                    <div class="btn-group">            
  <a data-toggle="dropdown" class="btn dropdown-toggle"   style="color:#ffffff"  onclick=" return false;" >更改优先级  <span class="caret"></span> </a>

  <ul class="dropdown-menu" role="menu">
  <li> <asp:LinkButton ID="lb_priority_low"   onclick="lb_priority_click"  class="opaction"   CommandArgument="low"   runat="server">低 low</asp:LinkButton></li>
   <li><asp:LinkButton ID="lb_priority_medium" onclick="lb_priority_click"   class="opaction"   CommandArgument="medium"   runat="server">中 medium</asp:LinkButton></li>
   <li><asp:LinkButton ID="lb_priority_high" onclick="lb_priority_click"    class="opaction"   CommandArgument="high"   runat="server">高 high</asp:LinkButton></li>
        <li><asp:LinkButton ID="lb_priority_critical" onclick="lb_priority_click"    class="opaction"   CommandArgument="critical"   runat="server">紧急 critical</asp:LinkButton></li>
</ul>
</div>      
     
         
  
                
                 | 
                
   

 <a  href="#" class="btn opaction" onclick="isselect(); op('time','../ajax/tickets_time.aspx?t=logs','设置处理问题花费时间','pc_list.aspx',true);return false;">处理时间...</a>

 

               

 <a href="javascript:;"  class="btn" onclick="isselect(); op('assignuser','../ajax/ticketlist_op.aspx?t=assignuser','指派用户处理问题','dashboard_my.aspx',1);">指派...</a> 

                |

  <asp:LinkButton ID="lb_favourite"   class="btn opaction"  OnClick="btn_favourite_click" runat="server">收藏</asp:LinkButton>
   

 
 
</ContentTemplate>
       </asp:UpdatePanel>
            
             </span>

        </div>            
















 
       <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
           <ContentTemplate>


 <asp:ListView ID="lv_lists" runat="server"  ItemContainerID="layoutTableTemplate" 
    DataKeyNames="id"  OnPagePropertiesChanging="lv_lists_PagePropertiesChanging"
  >
 
 
    <LayoutTemplate>
 
    <table class="table table-hover"  >
        <tr style="background-color:#f2f2f2">

        <th width="80px" > <input type="checkbox"   onclick="showaction(this);"  />ID</th>
        <th width=400px >主题</th>        
         <th width=80px>提交者</th>
        <th width=80px>优先级</th>
        <th width=80px>状态</th>
        <th width="120px">建立日期</th>
        <th width=80px>最后处理</th>
        <th width="100px">费时（h）</th>
        <th width="80px">是否关闭</th>
        <th width="50px">评价</th>     
       </tr>
        
         <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
        </table>
 
        
 
    </LayoutTemplate>

   
    
    <ItemTemplate>
  <tr class='<%#isbold(Eval("assignuid"),Eval("isclose")) %>'  >


<td>
    <input type="checkbox" class="chk_item" value='<%# Eval("id") %>'/> <%#Eval("id") %>

</td> 


<td  >
   

    
 

<a href='ticket_view.aspx?id=<%#Eval("id")%>' target="_blank"><%#Eval("title")%></a>
    <%#isvisible(Eval("status"),Eval("isclose"),Eval("sladate")) %> 
    

    
</td>



<td  >
 <%#Eval("username")%> 
</td>


<td class="f11" >

<%#Helpdesk.BLL.HelpdeskStatus.GetEnum("priority", Eval("priority").ToString())%> 
</td>


<td class="f11" >
<%#Helpdesk.BLL.HelpdeskStatus.GetEnum("status", Eval("status").ToString())%> 
</td>
 

<td   class="f11">
 
   <%# DateTime.Parse(Eval("createdate").ToString()).ToString("yyyy-MM-dd HH:mm")%> 
</td>


       

<td  > 
   <%#Eval("handleby")%>  
 </td>


<td  >
    <span class="spantime f11"> <%#GetHour(Eval("hour"))%> </span>
   
 </td>

 
 <td>
 
    <img src="images/c.gif" class="close<%#Eval("isclose")%>" />
      
 </td>

       
 <td>
   
<span runat="server" id="sp_rate" visible='<%#enableRate %>'>
<span  <%#Eval("ispoint").ToString()=="0"?" style=''":" style='display:none'" %> >
&nbsp;<img  id="_img_<%#Eval("id") %>" class="rate" src="images/rate.png" border=0 style=" cursor:pointer;"  onclick="Pop('DF_Ticket.aspx?tid=<%# Eval("id") %>&t=pop',520,400,'问题评分');"/>
 </span>
 
 </span>
      
 </td>

</tr>  
    </ItemTemplate>

</asp:ListView>        
 

     



    <div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm"  
       PagedControlID="lv_lists" runat="server" PageSize="20">
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>
 

      </ContentTemplate>



               <Triggers>
             

    <asp:AsyncPostBackTrigger  ControlID="ddl_status"/>
    <asp:AsyncPostBackTrigger  ControlID="ddl_priority"/>
    <asp:AsyncPostBackTrigger  ControlID="ddl_isclose"/>
    <asp:AsyncPostBackTrigger  ControlID="ddl_cat1id"/>
    <asp:AsyncPostBackTrigger  ControlID="Button1"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_del"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_solved_close"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_close"/>
    <asp:AsyncPostBackTrigger  ControlID="lbl_open"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_process_solved"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_process_unsolved"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_process_pending"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_priority_low"/>
    <asp:AsyncPostBackTrigger  ControlID="lb_priority_medium"/>


             

     <asp:AsyncPostBackTrigger  ControlID="lb_priority_high"/>
     <asp:AsyncPostBackTrigger  ControlID="lb_priority_critical"/>
     <asp:AsyncPostBackTrigger  ControlID="lb_favourite"/>
           </Triggers>


           </asp:UpdatePanel>






    
    <script>

        function showaction(obj) {

            var checkFlag = $(obj).is(':checked');
            $(".chk_item").prop("checked", checkFlag);
             

            if ($(".chk_item").is(":checked")) {
                $("#span_action").show();
            }
            else {
                $("#span_action").hide();
            }
        }



        $(document).ready()
        { 

             InitClick();

        }

 





    
          function InitClick()
          {
              
              if ($(".chk_item").is(":checked")) {
                  $("#span_action").show();
              }
              else {
                  $("#span_action").hide();
              }


              $(".dl").attr("title", "问题超时");
              $(".ws").attr("title", "等待工程师回复");
              $(".rate").attr("title", "IT人员可以通过电话回访，人工询问等方式获取提问人员对问题的反馈，然后评价");

              $(".spantime").each(
                   function () {
                       var t = $(this).html(); 
                       if (t == "" || t == 0) {
                           $(this).html("--")
                       }
                   }
                  );

             


              $(".opaction").click(

                 function () {
                     if (isselect()) {
                         return true;
                     }
                     else {
                         return false;
                     }
                 }
                );





              $(".chk_item").click(

                    function () {
                        if ($(".chk_item").is(":checked")) {
                            $("#span_action").show();
                        }
                        else {
                            $("#span_action").hide();
                        }

                    }
                 );

          }
       </script>

   

        <input type="hidden" name="hf_ids" id="hf_ids" />
  </asp:Content>