-- eliminados
This commit is contained in:
@@ -1,216 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="GraficaGantt.aspx.vb" Inherits="OI_GraficaGantt" %>
|
||||
|
||||
<asp:Content ID="ContentCP" ContentPlaceHolderID="CP" Runat="Server">
|
||||
<link href="../Metronic/GraficaGantt/dhtmlxgantt.css" rel="stylesheet" />
|
||||
<style>
|
||||
.scalasgants input:checked + label{
|
||||
border-bottom: 2px solid #45B6AF;
|
||||
}
|
||||
.scalasgants input{
|
||||
display:none;
|
||||
}
|
||||
.scalasgants label{
|
||||
padding:5px;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
.scalasgants label:hover {
|
||||
background-color: rgba(0,0,0,0.03);
|
||||
border-bottom: 2px solid #89FFF3;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentCss" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentE" ContentPlaceHolderID="E" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentHB" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentH" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentC" ContentPlaceHolderID="C" Runat="Server">
|
||||
<%--<asp:UpdatePanel ID="UPfiltros" runat="server"><ContentTemplate>--%>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" Text="Consultar" runat="server" CssClass="btn btn-default" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="width: 70px;">De:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlUsuario" CssClass="form-control input-sm" runat="server" DataTextField="Nombre" DataValueField="CveUsuario">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<%--<label class="col-md-1" style="width: 70px;">Para:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DDlPara" CssClass="form-control input-sm" runat="server" DataTextField="Nombre" DataValueField="CveUsuario">
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
<div class="col-md-2" >
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Revisión:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlRevision" CssClass="form-control input-sm" runat="server" DataTextField="Revision" DataValueField="CveRevision">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" >
|
||||
<div class="row">
|
||||
<label class="col-md-5 truncate">Primer Nivel:</label>
|
||||
<div class="col-md-7">
|
||||
<asp:DropDownList ID="DdlPrimerNivel" AutoPostBack="true" CssClass="form-control input-sm" runat="server" DataTextField="Asunto" DataValueField="CveEvento">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" >
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Segundo Nivel:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlSegundoNivel" CssClass="form-control input-sm" runat="server" DataTextField="Asunto" DataValueField="CveEvento">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" runat="server" id="TdSubTotales" visible="false">
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">SubTotales:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlSubtotales" CssClass="form-control input-sm" runat="server">
|
||||
<asp:ListItem Text="Sin Subtotales" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Trimestral" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Cuatrimestral" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%--</ContentTemplate></asp:UpdatePanel>--%>
|
||||
<br />
|
||||
<asp:HiddenField ID="Asunto" runat="server" />
|
||||
<asp:HiddenField ID="FechaInicio" runat="server" />
|
||||
<asp:HiddenField ID="Duracion" runat="server" />
|
||||
<asp:HiddenField ID="EventoPadre" runat="server" />
|
||||
<asp:Button ID="NewUser" runat="server" CssClass="hidden" Text="Button" />
|
||||
|
||||
<div class="portlet light calendar ">
|
||||
<div class="portlet-title ">
|
||||
<div class="caption">
|
||||
<i class="icon-calendar font-green-sharp"></i>
|
||||
<span class="caption-subject font-green-sharp bold uppercase">TaReaS</span>
|
||||
</div>
|
||||
<div class="actions scalasgants">
|
||||
<input type="radio" id="scaleD" name="scale" value="1" /><label for="scaleD">Día</label>
|
||||
<input type="radio" id="scaleS" name="scale" value="2" /><label for="scaleS">Semana</label>
|
||||
<input type="radio" id="scaleM" name="scale" value="3" checked="checked" /><label for="scaleM">Mes</label>
|
||||
<input type="radio" id="scaleA" name="scale" value="4" /><label for="scaleA">Año</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div id="gantt_here" style='width: 100%; height: 600px;'></div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="ContentJS" ContentPlaceHolderID="JS" Runat="Server">
|
||||
<script src="../Metronic/GraficaGantt/dhtmlxgantt.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function setScaleConfig(value){
|
||||
switch (value) {
|
||||
case "1":
|
||||
gantt.config.scale_unit = "day";
|
||||
gantt.config.step = 1;
|
||||
gantt.config.date_scale = "%d %M";
|
||||
gantt.config.subscales = [];
|
||||
gantt.config.scale_height = 27;
|
||||
gantt.templates.date_scale = null;
|
||||
break;
|
||||
case "2":
|
||||
var weekScaleTemplate = function(date){
|
||||
var dateToStr = gantt.date.date_to_str("%d %M");
|
||||
var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
|
||||
return dateToStr(date) + " - " + dateToStr(endDate);
|
||||
};
|
||||
|
||||
gantt.config.scale_unit = "week";
|
||||
gantt.config.step = 1;
|
||||
gantt.templates.date_scale = weekScaleTemplate;
|
||||
gantt.config.subscales = [
|
||||
{unit:"day", step:1, date:"%D" }
|
||||
];
|
||||
gantt.config.scale_height = 50;
|
||||
break;
|
||||
case "3":
|
||||
gantt.config.scale_unit = "month";
|
||||
gantt.config.date_scale = "%F, %Y";
|
||||
gantt.config.subscales = [
|
||||
{unit:"day", step:1, date:"%j, %D" }
|
||||
];
|
||||
gantt.config.scale_height = 50;
|
||||
gantt.templates.date_scale = null;
|
||||
break;
|
||||
case "4":
|
||||
gantt.config.scale_unit = "year";
|
||||
gantt.config.step = 1;
|
||||
gantt.config.date_scale = "%Y";
|
||||
gantt.config.min_column_width = 50;
|
||||
|
||||
gantt.config.scale_height = 90;
|
||||
gantt.templates.date_scale = null;
|
||||
|
||||
|
||||
gantt.config.subscales = [
|
||||
{unit:"month", step:1, date:"%M" }
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var datagant =<%= DTTogant()%>;
|
||||
|
||||
function convertDate(inputFormat) {
|
||||
function pad(s) { return (s < 10) ? '0' + s : s; }
|
||||
var d = new Date(inputFormat);
|
||||
return [pad(d.getDate()), pad(d.getMonth() + 1), d.getFullYear()].join('/');
|
||||
}
|
||||
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
setScaleConfig('3');
|
||||
// gantt.config.sort = true;
|
||||
gantt.init("gantt_here");
|
||||
gantt.parse(datagant);
|
||||
gantt.attachEvent("onLightbox", function (task_id){
|
||||
AbrirVentana('/OI/EventoDetalle.aspx?Masterimpoup=true&CveTipoEvento=3&CveEventoPadre='+task_id,900,630,'Proyecto');
|
||||
gantt.hideLightbox();
|
||||
});
|
||||
|
||||
var func = function (e) {
|
||||
e = e || window.event;
|
||||
var el = e.target || e.srcElement;
|
||||
var value = el.value;
|
||||
setScaleConfig(value);
|
||||
gantt.render();
|
||||
};
|
||||
|
||||
var els = document.getElementsByName("scale");
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].onclick = func;
|
||||
}
|
||||
gantt.attachEvent("onAfterTaskAdd", function (id, item) {
|
||||
// console.log(item.text + " itemstart:" + convertDate(item.start_date) + " " + item.start_date + " duration:" + item.duration + " pogresss:" + item.progress + " Parent:" + item.parent);
|
||||
$('#<%= Asunto.ClientID%>').val(item.text);
|
||||
$('#<%= FechaInicio.ClientID%>').val(convertDate(item.start_date));
|
||||
$('#<%= EventoPadre.ClientID%>').val(item.parent);
|
||||
$('#<%= Duracion.ClientID%>').val(item.duration);
|
||||
$('#<%= NewUser.ClientID%>').click();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class OI_GraficaGantt
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTDatos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
DdlSegundoNivel.DataBind()
|
||||
DdlSegundoNivel.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlPrimerNivel.DataBind()
|
||||
DdlPrimerNivel.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
CargaCombos()
|
||||
CargaEventos()
|
||||
CargaComboP1()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaCombos()
|
||||
'usuarios
|
||||
DdlUsuario.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlUsuario.DataBind()
|
||||
DdlUsuario.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlUsuario.SelectedValue = -1
|
||||
'Revision
|
||||
Dim ObjOI As New ClsOIEventos
|
||||
|
||||
If ObjOI.GetRevisionesEventos(UsuarioActual.CveEmpresa) Then
|
||||
DdlRevision.DataSource = ObjOI.DtResultados
|
||||
DdlRevision.DataBind()
|
||||
End If
|
||||
ObjOI.Dispose()
|
||||
DdlRevision.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlRevision.SelectedValue = -1
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaEventos()
|
||||
Dim de As Integer = DdlUsuario.SelectedValue
|
||||
Dim cverevision As Integer = DdlRevision.SelectedValue
|
||||
Dim objoi As New ClsOIEventos
|
||||
If objoi.GetEventosProyecto(UsuarioActual.CveEmpresa, de, cverevision, DdlPrimerNivel.SelectedValue, DdlSegundoNivel.SelectedValue) Then
|
||||
DTDatos = objoi.DtResultados
|
||||
End If
|
||||
objoi.Dispose()
|
||||
End Sub
|
||||
Private Sub CargaComboP1()
|
||||
DdlPrimerNivel.Items.Clear()
|
||||
DdlPrimerNivel.DataSource = DTDatos.FiltraParametros("CveEventoPadre = 0")
|
||||
DdlPrimerNivel.DataBind()
|
||||
DdlPrimerNivel.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSegundoNivel.Items.Clear()
|
||||
DdlSegundoNivel.DataBind()
|
||||
DdlSegundoNivel.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaComboP2()
|
||||
DdlSegundoNivel.Items.Clear()
|
||||
DdlSegundoNivel.DataSource = DTDatos.FiltraParametros(String.Format("CveEventoPadre = {0} OR {0}=-1", DdlPrimerNivel.SelectedValue))
|
||||
DdlSegundoNivel.DataBind()
|
||||
DdlSegundoNivel.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlPrimerNivel_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPrimerNivel.SelectedIndexChanged
|
||||
CargaComboP2()
|
||||
End Sub
|
||||
Public Function DTTogant() As String
|
||||
Dim StrDatos As New StringBuilder
|
||||
StrDatos.Append("{""data"": [ ")
|
||||
Dim dttemp As DataTable = GetDatos()
|
||||
If Not (dttemp Is Nothing) Then
|
||||
For Each item As DataRow In dttemp.Rows '28-03-2013
|
||||
Dim duracion = DateDiff(DateInterval.Day, item("FechaInicio").ToString().ToDate(), item("FechaFin").ToString().ToDate())
|
||||
If item("ISFhater").ToString = "1" Then
|
||||
StrDatos.AppendFormat("{{""id"": {0}, ""text"": ""{1}"", ""start_date"": ""{2}"",""type"":""Project"", ""progress"": {4},""parent"":{5}, ""open"": true,""end_date"": ""{6}"",""users"":""{7}""}},", item("CveEvento").ToString, item("Asunto").ToString, If(item("FechaInicio").ToString <> "", item("FechaInicio").ToString().Substring(0, 10), ""), duracion, item("Avance").ToString.ToEntero / 100, item("CveEventoPadre").ToString().ToEntero, If(item("FechaFin").ToString <> "", item("FechaFin").ToString().Substring(0, 10), ""), item("UsuarioDe").ToString)
|
||||
Else
|
||||
StrDatos.AppendFormat("{{""id"": {0}, ""text"": ""{1}"", ""start_date"": ""{2}"", ""duration"": ""{3}"", ""progress"": {4},""parent"":{5}, ""open"": true,""end_date"": ""{6}"",""users"":""{7}""}},", item("CveEvento").ToString, item("Asunto").ToString, If(item("FechaInicio").ToString <> "", item("FechaInicio").ToString().Substring(0, 10), ""), duracion, item("Avance").ToString.ToEntero / 100, item("CveEventoPadre").ToString().ToEntero, If(item("FechaFin").ToString <> "", item("FechaFin").ToString().Substring(0, 10), ""), item("UsuarioDe").ToString)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
Return StrDatos.ToString.Substring(0, StrDatos.ToString.Length - 1) & "]}"
|
||||
End Function
|
||||
|
||||
Public Function GetDatos() As DataTable
|
||||
Dim dt As DataTable = DTDatos.Copy
|
||||
|
||||
'If Not (DdlPrimerNivel.SelectedValue = -1 And DdlSegundoNivel.SelectedValue = -1) Then
|
||||
' dt.Clear()
|
||||
'End If
|
||||
Return dt
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub NewUser_Click(sender As Object, e As EventArgs) Handles NewUser.Click
|
||||
Dim FechaI As Date = FechaInicio.Value.ToDate()
|
||||
Dim Fechaf As Date = FechaI.AddDays(Duracion.Value.ToEntero)
|
||||
Dim objOI As New ClsOIEventos
|
||||
If objOI.AddEventoProyecto(Asunto.Value, Asunto.Value, 1, UsuarioActual.CveUsuario, -1, FechaI, Fechaf,
|
||||
EventoPadre.Value.ToEntero, -1, "", -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario,-1,
|
||||
UsuarioActual.CveEmpresa) Then
|
||||
Dim newrow As DataRow = DTDatos.NewRow()
|
||||
newrow("CveEvento") = objOI.CveEvento
|
||||
newrow("Asunto") = Asunto.Value
|
||||
newrow("FechaInicio") = FechaInicio.Value
|
||||
newrow("FechaFin") = Fechaf.ToString("dd/MM/yyyy")
|
||||
newrow("CveEventoPadre") = EventoPadre.Value
|
||||
DTDatos.Rows.Add(newrow)
|
||||
Else
|
||||
Alert("No se logro agregar la tarea", TipoMensaje.MsgInformacion)
|
||||
|
||||
End If
|
||||
objOI.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaEventos()
|
||||
' RegistraScript(String.Format("debugger;gantt.parse('{0}');datagant='{0}';", DTTogant()))
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user