This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-08-28 15:54:21 -07:00
parent 5e1b170442
commit 1b82a333c9
6 changed files with 204 additions and 114 deletions

View File

@@ -219,7 +219,7 @@
<ajax:ValidatorCalloutExtender ID="VcoFechaI" runat="server" HighlightCssClass="vco" TargetControlID="RFVtxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-sm-6" style ="display:none;">
<div class="col-sm-6" style="display: none;">
<div class="input-group form-group form-md-line-input date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:TextBox ID="txtFechaF" runat="server" autocomplete="false" CssClass="form-control ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px " placeholder=""></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVtxtFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpTarea"></asp:RequiredFieldValidator>--%>
@@ -509,7 +509,18 @@
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
let CveRol = -1;
let CveSucursal = -1;

View File

@@ -401,7 +401,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
System.IO.File.Move(rutaarchivoOri, ruta);
}
this.Alert("Se ha agregadó la nueva convocatoria", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEvento={0}\");", CveEvento));
this.Alert(string.Format("Se ha agregadó la nueva convocatoria.<br/><a href=\"data:text/plain;charset=utf-8,{0}\" download=\"Agendar.ics\" class=\"btn btn-default\">⏰ Agendar</a>", HttpUtility.UrlEncode(ICString)), ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEvento={0}\");", CveEvento));
}
}
}
@@ -422,7 +422,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
{
objOI.Commit();
enviarConvocatoria(RCveEvento);
Alert("Convocatoria actualizada");
Alert(string.Format("Convocatoria actualizada.<br/><a href=\"data:text/plain;charset=utf-8,{0}\" download=\"Agendar.ics\" class=\"btn btn-default\">⏰ Agendar</a>", HttpUtility.UrlEncode(ICString)));
}
else
{
@@ -586,13 +586,20 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
return string.Format("{0}/{1}", HttpContext.Current.Request.Url.ToString().Replace(HttpContext.Current.Request.Url.PathAndQuery, ""), addstr);
}
string UsuarioDemail = "";
private string MailgetBodyConvocatoria(int RCveEvento)
string ICString = "";
private void enviarConvocatoria(int RCveEvento)
{
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
string Body;
string UsuarioDe = "";
#region "Body"
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
UsuarioDe = "";
string UsuarioPara = "";
string UsuarioDeAbr = "";
string CorreoRegistro = "";
System.Data.DataTable dttareas;
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
{
@@ -600,7 +607,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
{
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
UsuarioDe = drow["NombreRegistro"].ToString();
UsuarioDemail= drow["NombreRegistro"].ToString();
UsuarioDemail = drow["NombreRegistro"].ToString();
CorreoRegistro = drow["CorreoRegistro"].ToString().Split(',')[0].Split(';')[0];
Folio = drow["Folio"].ToString().ToEntero();
Link = GetDominio(string.Format("OI/ConvocatoriaDetalle.aspx?CveEvento={0}", RCveEvento));
Asunto = drow["Asunto"].ToString();
@@ -700,13 +708,12 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
StrMail.Append(" </div>");
StrMail.Append(" </div>");
StrMail.Append("</html></body>");
return StrMail.ToString();
}
private void enviarConvocatoria(int RCveEvento)
{
string Body;
Body = MailgetBodyConvocatoria(RCveEvento);
#endregion
Body = StrMail.ToString();//MailgetBodyConvocatoria(RCveEvento);
string ArrayCC = "";
//ViewState("Para") = GlobalDTUsuarios(CveUsuarioIng)(0)("correo").ToString;
//ViewState("Asunto") = string.Format("SIG - Minuta {0}", TxtAsunto.Text);
@@ -729,6 +736,10 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
ClsSisMail.ArchivoMail mailfile = new ClsSisMail.ArchivoMail { Ruta = string.Format("{0}Imagenes\\Bell.png", ModExtensiones.DirectorioBaseEmpresas), NombreArchivo = "Bell.png" };
LSRutasMail.Add(mailfile);
ICString = GenerateIcsContent(string.Format("{0:yyyy/MM/dd} 00:00", txtFechaI.Text.ToDateTime()).ToDateTime(), string.Format("{0:yyyy/MM/dd} 23:59", txtFechaI.Text.ToDateTime()).ToDateTime(),
UsuarioDe, CorreoRegistro, TxtLugar.Text, Asunto,Descripcion,string.Format("Convocatoria_{0}",RCveEvento) );
ClsSisMail.ArchivoMail ICSFile = new ClsSisMail.ArchivoMail { Ruta = "",ArchivoBinario= Encoding.ASCII.GetBytes(ICString), NombreArchivo = "Agendar.ics" };
LSRutasMail.Add(ICSFile);
ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
@@ -742,31 +753,44 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
}
public string GenerateIcsContent(DateTime dateStart,
DateTime dateEnd, string email, string location,
string summary, string description)
public string GenerateIcsContent(DateTime FechaInicio, DateTime FechaFin, string Nombreorganizador, string Correoorganizador, string Ubicacion, string Asunto, string descripcion, string uuid)
{
string DateFormat = "yyyyMMddTHHmmssZ";
var s = dateStart.ToUniversalTime().ToString(DateFormat);
var e = dateEnd.ToUniversalTime().ToString(DateFormat);
var iCal = string.Format(@"BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
ORGANIZER:MAILTO:{0}
DTSTART:{1}
DTEND:{2}
LOCATION:{3}
UID:{4}
DTSTAMP:{4}
SUMMARY:{5}
DESCRIPTION:{6}
PRIORITY:5
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR", email, s, e, location,
DateTime.Now.ToUniversalTime().ToString(DateFormat),
summary, description);
return iCal;
var DTSTART = FechaInicio.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
var DTEND = FechaFin.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
/*
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
*/
StringBuilder strICS = new StringBuilder();
strICS.AppendLine("BEGIN:VCALENDAR");
strICS.AppendLine("VERSION:2.0");
strICS.AppendLine("METHOD:PUBLISH");
strICS.AppendLine("BEGIN:VEVENT");
strICS.AppendLine(string.Format("ORGANIZER;CN={0}:MAILTO:{1}", Nombreorganizador.Replace(":", "").Replace(";", ""), Correoorganizador));
strICS.AppendLine(string.Format("DTSTART:{0}", DTSTART));
strICS.AppendLine(string.Format("DTEND:{0}", DTEND));
strICS.AppendLine(string.Format("LOCATION:{0}", Ubicacion));
strICS.AppendLine(string.Format("UID:{0}", uuid));
strICS.AppendLine(string.Format("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ")));
strICS.AppendLine(string.Format("SUMMARY:{0}", Asunto));
strICS.AppendLine(string.Format("DESCRIPTION:{0}", descripcion));
strICS.AppendLine("PRIORITY:5");
strICS.AppendLine("CLASS:PUBLIC");
strICS.AppendLine("END:VEVENT");
strICS.AppendLine("END:VCALENDAR");
return strICS.ToString();
}
}

View File

@@ -746,25 +746,31 @@ public partial class OI_MinutaDetalle : ClsPaginas
protected void LnkTerminarMinuta_Click(object sender, EventArgs e)
{
// Cambiar el estatus a Terminada para inabilitarla y que no se pueda modificar
ClsOIEventos objOI = new ClsOIEventos();
int tCveSeguimiento;
bool HuboError = false;
using (ClsOIEventos objOI = new ClsOIEventos())
{
objOI.IniciaTransacSQL();
tCveSeguimiento = objOI.AddEventoComentario2(RCveEvento, "Termino minuta.", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (tCveSeguimiento > 0)
{
if (!objOI.UpdateEstatusEvento2(4, tCveSeguimiento, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
HuboError = true;
}
else { HuboError = true; }
if (HuboError == false)
{
objOI.Commit();
}
else
HuboError = true;
// 'Envia minuta si es modificada
{
objOI.RollBack();
}
}
if (HuboError == false)
{
if (!EnviarMinuta()) { HuboError = true; Alert("Ocurrió un error al terminar la minuta. no se pudo enviar el correo.", ModExtensiones.TipoMensaje.MsgError); }
}
if (HuboError == false)
@@ -775,22 +781,6 @@ public partial class OI_MinutaDetalle : ClsPaginas
script = string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEventoPadre={0}\");", RCveEvento);
}
Alert("La minuta ha finalizado.", ModExtensiones.TipoMensaje.MsgInformacion, script);
objOI.Commit();
}
else
{
Alert("Ocurrió un error al terminar la minuta. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError);
objOI.RollBack();
}
objOI.Dispose();
if (HuboError == false)
{
if (!EnviarMinuta())
HuboError = true;
Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion);
}
LnkEnviarMinuta.Visible = true;
@@ -833,7 +823,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
private string MailgetBodyMinuta()
{
int Folio=0; string Link=""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai=DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
string UsuarioDe = "";
string UsuarioPara = "";
string UsuarioDeAbr = "";
@@ -875,7 +865,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
if (UsuarioPara != null)
{
string[] str = UsuarioPara.Split(' ');
if (str.Length > 0 && str[0].Length >0)
if (str.Length > 0 && str[0].Length > 0)
{
UsuariParaAbr = str[0].Substring(0, 1).ToUpper();
}
@@ -940,7 +930,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
if(dttareas != null && dttareas.Rows.Count > 0)
if (dttareas != null && dttareas.Rows.Count > 0)
{
StrMail.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%\">");
StrMail.Append(" <thead>");
@@ -954,7 +944,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
StrMail.Append(" </tr>");
StrMail.Append(" </thead>");
StrMail.Append(" <tbody>");
foreach (System.Data.DataRow drow in dttareas.Rows )
foreach (System.Data.DataRow drow in dttareas.Rows)
{
StrMail.Append(" <tr>");
@@ -1006,14 +996,14 @@ public partial class OI_MinutaDetalle : ClsPaginas
//System.Threading.Thread Hilo = new System.Threading.Thread(MandaCorreo);
//Hilo.Start();
string abre = "";
using (ClsOIEventos ObjOI_E =new ClsOIEventos())
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
{
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados!=null && ObjOI_E.DtResultados.Rows.Count >0)
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados != null && ObjOI_E.DtResultados.Rows.Count > 0)
{
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Rows )
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Rows)
{
if (item["Correo"].ToString().Trim().Length >0)
ArrayCC = string.Format("{0}{1}{2}", ArrayCC,abre, item["Correo"].ToString().Trim());
if (item["Correo"].ToString().Trim().Length > 0)
ArrayCC = string.Format("{0}{1}{2}", ArrayCC, abre, item["Correo"].ToString().Trim());
abre = ";";
}
}
@@ -1025,7 +1015,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
ClsSisMail Mail = new ClsSisMail();
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() +";"+ TxtCorreoExterno.Text, TxtAsunto.Text, Body, CCP: ArrayCC,Archivos: LSRutasMail);
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() + ";" + TxtCorreoExterno.Text, TxtAsunto.Text, Body, CCP: ArrayCC, Archivos: LSRutasMail);
//Alert("Se Envió por correo la Minuta", ModExtensiones.TipoMensaje.MsgInformacion);
Retorno = true;
}
@@ -1378,8 +1368,44 @@ public partial class OI_MinutaDetalle : ClsPaginas
LnkTerminarMinuta_Click(null, null);
}
public string GenerateIcsContent(DateTime FechaInicio, DateTime FechaFin, string Nombreorganizador, string Correoorganizador, string Ubicacion, string Asunto, string descripcion, string uuid)
{
var DTSTART = FechaInicio.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
var DTEND = FechaFin.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
/*
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
*/
StringBuilder strICS = new StringBuilder();
strICS.Append("BEGIN:VCALENDAR");
strICS.Append("VERSION:2.0");
strICS.Append("METHOD:PUBLISH");
strICS.Append("BEGIN:VEVENT");
strICS.AppendFormat("ORGANIZER;CN={0}:MAILTO:{1}", Nombreorganizador.Replace(":", "").Replace(";", ""), Correoorganizador);
strICS.AppendFormat("DTSTART:{0}", DTSTART);
strICS.AppendFormat("DTEND:{0}", DTEND);
strICS.AppendFormat("LOCATION:{0}", Ubicacion);
strICS.AppendFormat("UID:{0}", uuid);
strICS.AppendFormat("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ"));
strICS.AppendFormat("SUMMARY:{0}", Asunto);
strICS.AppendFormat("DESCRIPTION:{0}", descripcion);
strICS.Append("PRIORITY:5");
strICS.Append("CLASS:PUBLIC");
strICS.Append("END:VEVENT");
strICS.Append("END:VCALENDAR");
return strICS.ToString();
}
protected void LnkOpenModalAsistencia_Click(object sender, EventArgs e)

View File

@@ -31,12 +31,16 @@
padding-left: 10px;
line-height: 25px;
}
.gantt-samples-banner_controls_bar.controls_bar,.gantt_scale_line .gantt_scale_cell,.gantt_grid_scale .gantt_grid_head_cell ,.gantt_grid_scale .gantt_grid_head_cell a,.gantt_grid_scale .gantt_grid_head_cell a:hover {
background-color:#95a5a6 !important;
color:#FFF !important;
}
</style>
<%--<link href="/Metronic/assets/global/plugins/GantJS/jsgantt.css" rel="stylesheet" type="text/css" />--%>
<link rel="stylesheet" href="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Proyecto:
Proyecto:<asp:Label ID="LblAsunto" runat="server" Text=""></asp:Label>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
@@ -70,6 +74,9 @@
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="year">
<span>Mes</span></label>
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="yearyear">
<span>año</span></label>
<div id="filter_hours" style="display: none;">
@@ -204,6 +211,7 @@
<script>
let RCveEvento =<%= RCveEvento %>;
function NuevoEvento(CveEvento) {
$('.txtCveEvento').val(CveEvento);
$('.BtnopenmodalClickGant').click();
@@ -249,6 +257,16 @@
{ unit: "week", step: 1, date: "#%W" }
];
break;
case "yearyear":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "month";
gantt.config.date_scale = "%y %M";
gantt.config.scale_height = 60;
show_scale_options();
gantt.config.subscales = [
{ unit: "month", step: 1, date: "#%M" }
];
break;
}
set_scale_units();
gantt.render();
@@ -319,9 +337,9 @@
{ name: "text", label: "Proyecto ", width: "*", min_width: 350, tree: true, resize: true, template: function (obj) { return "<a href=\"/OI/TareaDetalle.aspx?CveEvento="+obj.id+"\" target=\"_Blank\">" + obj.text + " </a>" } },
{ name: "start_date", label: "Inicio", min_width: 90, align: "center" },
{ name: "end_date", label: "Fin", min_width: 90, align: "center" },
{ name: "progress", label: "Avance", align: "center", template: function (obj) { return "" + (obj.progress * 100) + " %" } },
{ name: "duration", label: "Duracion", align: "center" },
{ name: "new", label: "<i class='fa fa-plus'></i>", align: "center",template: function (obj) { return "<a onclick=\"NuevoEvento("+obj.id+");\" target=\"_Blank\"><i class='fa fa-plus'></i> </a>" } }
{ name: "progress", label: "Avance", align: "center", template: function (obj) { return "" + (obj.progress * 100).toFixed(2) + " %" } },
{ name: "duration", label: "Duración", align: "center" },
{ name: "new", label: "<a onclick=\"NuevoEvento("+ RCveEvento +");\" target=\"_Blank\"><i class='fa fa-plus'></i></a>", align: "center",template: function (obj) { return "<a onclick=\"NuevoEvento("+obj.id+");\" target=\"_Blank\"><i class='fa fa-plus'></i> </a>" } }
/*{name:"staff", label:"Holder(s)", template:function(obj){return obj.holder+"("+obj.progress+")"} },*/
//{ name: "add", label: "" }
];

View File

@@ -50,6 +50,13 @@ public partial class OI_Proyecto : ClsPaginas
str.AppendLine("datosGant=[");
using (ClsOIEventos oieve = new ClsOIEventos())
{
if (oieve.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && oieve.DtResultados.Rows.Count > 0)
{
System.Data.DataRow drow = oieve.DtResultados.Rows[0];
LblAsunto.Text = drow["Asunto"].ToString();
}
if (oieve.GetTareaConHijos(RCveEvento,UsuarioActual.CveEmpresa))
{
foreach (System.Data.DataRow dr in oieve.DtResultados.Select("Nivel > 0"))

View File

@@ -92,6 +92,10 @@