Type IncidentData(ID As String, Title As String, BeginTime As String, EndTime As String, Color As Int)
Ugh, thanks for the work!Attached you find a demonstrator project for your display.
It is a B4XPages project and the graphic display is a CustomView called xTimeCalendar.
It needs more work to fit exactly what you want or need.
There is no scrolling yet, but this will depend on your display requirements.
There are more questions:
- How many days do you want to display ?
This might need the scrolling.
- How do you think you will prepare the data for the display ?
Currently the display data is organized in rows.
Each row has this Structure:
When the ID is empty only the Title is displayed or if the Title is empty nothing is displayed.B4X:Type IncidentData(ID As String, Title As String, BeginTime As String, EndTime As String, Color As Int)
View attachment 156376
Will be added.The organization of the data is perfect like this. I would add two more columns: Agency or service responsible for the task and another that indicates the status of the task (P - planned, C - in progress, F - completed).
This was already on my to do list.For asking (I hope I don't overdo it), there is an event that when clicking on a task can return the row() data, and thus be able to link to the database record.
I will go further.I know there are many things, the effort seems great to me, so how far to go is in your hands...
Will be added.
This was already on my to do list.
I wanted to first have your feedback with more information
I will go further.
Other questions :
1. Are the comments in the database encrypted ? The texts look strange.
2. Looking at the example in post #6, are all the rows considered as one intervention with different tasks ore are all considered independently ?
3. How are the time stamps saved in the database, I suppose as Strings and not as time Ticks.
4. You have 4 time stamps in the database, what do they represent ?
Do they indirectly indicate the status (P - planned, C - in progress, F - completed)?
horaInicio = begin time, incident has begun ?
horaPrevista = scheduled begin time, incident has not begun ?
horaCurso = current time, incident is in progress ?
horaFin = end time, incident is finished ?
Sub IniciaCargaDatos
'Son tareas previstas cuando horaInicio == horaPrevista
Private TaskList As List
TaskList.Initialize
Dim Cursor, Cursor2, Cursor3 As ResultSet
Cursor = SQL1.ExecQuery("Select DISTINCT sector, color FROM cards WHERE horaInicio = horaPrevista ORDER BY rowid")
Do While Cursor.NextRow
Log(Cursor.GetString("sector"))
If Cursor.GetString("sector") <> Null Then
FireIncidents.AddGroup(Cursor.GetString("sector") & "-P", Cursor.GetString("sector"), TaskList, Cursor.GetInt("color"))
Cursor2 = SQL1.ExecQuery2("SELECT DISTINCT recurso FROM cards WHERE sector = ? AND horaInicio = horaPrevista ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor2.NextRow
TaskList.Add(Cursor2.GetString("recurso"))
Loop
Cursor3 = SQL1.ExecQuery2("SELECT * FROM cards WHERE sector = ? AND horaInicio = horaPrevista ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor3.NextRow
'pONE COMO FIN 3 HORAS MÁS DE LA ACTUAL
FireIncidents.AddTask(Cursor3.GetString("recurso"), Cursor3.GetString("tareatxt"), "Manuel", Cursor3.GetString("horaPrevista"),DateTime.Date(DateTime.Now + DateTime.TicksPerHour*3), Cursor3.GetString("color"))
Loop
End If
Loop
'Son tareas en Curso cuando horaInicio == horaCurso
FireIncidents.AddEmpty
Cursor = SQL1.ExecQuery("Select DISTINCT sector, color FROM cards WHERE horaInicio = horaCurso ORDER BY rowid")
Do While Cursor.NextRow
Log(Cursor.GetString("sector"))
If Cursor.GetString("sector") <> Null Then
FireIncidents.AddGroup(Cursor.GetString("sector") & "-C", Cursor.GetString("sector"), TaskList, Cursor.GetInt("color"))
Cursor2 = SQL1.ExecQuery2("SELECT DISTINCT recurso FROM cards WHERE sector = ? AND horaInicio = horaCurso ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor2.NextRow
TaskList.Add(Cursor2.GetString("recurso"))
Loop
Cursor3 = SQL1.ExecQuery2("SELECT * FROM cards WHERE sector = ? AND horaInicio = horaCurso ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor3.NextRow
'pONE COMO FIN 3 HORAS MÁS DE LA ACTUAL
FireIncidents.AddTask(Cursor3.GetString("recurso"), Cursor3.GetString("tareatxt"), "Manuel", Cursor3.GetString("horaCurso"),DateTime.Date(DateTime.Now + DateTime.TicksPerHour*3), Cursor3.GetString("color"))
Loop
End If
Loop
'Son tareas en Finalizadas cuando horaInicio == horaFin
FireIncidents.AddEmpty
Cursor = SQL1.ExecQuery("Select DISTINCT sector, color FROM cards WHERE horaInicio = horaFin ORDER BY rowid")
Do While Cursor.NextRow
Log(Cursor.GetString("sector"))
If Cursor.GetString("sector") <> Null Then
FireIncidents.AddGroup(Cursor.GetString("sector") & "-F", Cursor.GetString("sector"), TaskList, Cursor.GetInt("color"))
Cursor2 = SQL1.ExecQuery2("SELECT DISTINCT recurso FROM cards WHERE sector = ? AND horaInicio = horaFin ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor2.NextRow
TaskList.Add(Cursor2.GetString("recurso"))
Loop
Cursor3 = SQL1.ExecQuery2("SELECT * FROM cards WHERE sector = ? AND horaInicio = horaFin ORDER BY recurso", Array As String(Cursor.GetString("sector")))
Do While Cursor3.NextRow
FireIncidents.AddTask(Cursor3.GetString("recurso"), Cursor3.GetString("tareatxt"), "Manuel", Cursor3.GetString("horaPrevista"), Cursor3.GetString("horaFin"), Cursor3.GetString("color"))
Loop
End If
Loop
Cursor.Close
Cursor2.Close
Cursor3.close
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?