Recent

Author Topic: TVPlanit Reboot  (Read 33552 times)

JD

  • Hero Member
  • *****
  • Posts: 1848
TVPlanit Reboot
« on: June 30, 2016, 08:41:37 pm »
Hi there everyone,

I just downloaded the lastest svn version of tvplanit and I have to commend wp & DonAlfredo for their good work in making these components usable in Lazarus.

@wp

a) I want to convert the dialogs (event, resource ) to French. How do I do it? I initially wanted to recreate my own event dialog from scratch but it may be easier to just translate what already exists.

b) I want to save the events to a remote PostgreSQL database. Your TVpIniDataStore gives me some ideas because I do not want to replicate the data structure of the Events, Resources, Tasks & Contacts tables on the server.

I'll just save the data to JSON strings and send them to the remote server for updating the database.

I only need some of the fields in those tables. Can I get away with just creating only the fields I need & letting go of the rest?

c) How can I customize the categories for events and give them more meaningful descriptions?

d) I want to use it for an employee scheduling app. So I'll need to create a table with employee names in rows and dates in columns, similar to a Gantt chart. I don't think tvplanit can do that but what about exporting the events data to fpspreadsheet?

JD
« Last Edit: June 30, 2016, 08:56:36 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #1 on: June 30, 2016, 09:21:50 pm »
(a) Translation is done as usual by means of po files, you don't have to touch the provided dialogs. Use poedit to translate the strings in "vpsr.po" (folder "languages") to French and save as "vpsr.fr.po". If you want to share this work upload the translated file here so that I can add it to the library. The demo project (examples/demo) is quite advanced and applies translation as well. The strings of the demo project are translated in the demo.*.po files.

(b) Well, the Ini Storage was just an excercise for me to better understand the datastores, it shows that the datastores can be very very simple. For a dedicated database system such as PostgreSQL you better use the SqliteDatastore or ZeosDataastore as a template. I'd guess PostgreSQL could be very similar. Unfortunately I do not have much experience with the big database systems, otherwise I'd already have written more dedicated datastores.

You can avoid writing a dedicated datastore by using the FlexDatastore. See the discussion in the other thread until a special example sample is available within the distribution.

There is also an SQLDatastore (vpsqlds) which appears to be very general and can be adapted by means of sqldialect units. But I though it would be easier to write dedicated datastores and did not yet look into this in detail.

I am not sure about missing fields, probably there will be crashes at least with the dedicated datastores. FlexDatastore might work because there is a separate assignment of database fields to internal fields. Once I'll be through with the debugging (there are still lots of bugs...) I'll have a look at missing fields. I think it shouldn't be too difficult: it would be sufficient to check the existence of fields on TCustomDBDatastore (unit vpdbds) which is the ancestor of all database-related datastores.

(c) The datastore has a property CategoryColorMap in which you can define the descriptions and colors of the 10 predefined categories (so far, it is not possible to change this number). Have a look at examples/demo, it customizes the first two categories.

(d) No, tvplanit cannot do Gantt charts. But since all data are stored in an ordinary database, nothing prevents you from exporting the data to special Gantt tools or fpspreadsheet. The Sqlite and ZeosDatastore expose the internal datasets as public properties.

Maybe I should mention that I have some plans for a Gantt series in TAChart in the future.

[EDIT]
I forgot to mention that the sqlite3 and zeos datastores are in separate packages, laz_visualplanit_sqlite3.lpk and laz_visualplanit_zeos.lpk because the required database components are not part of the standard Lazarus distribution.
« Last Edit: June 30, 2016, 09:34:32 pm by wp »

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TVPlanit Reboot
« Reply #2 on: June 30, 2016, 10:10:22 pm »
(a) Translation is done as usual by means of po files, you don't have to touch the provided dialogs. Use poedit to translate the strings in "vpsr.po" (folder "languages") to French and save as "vpsr.fr.po". If you want to share this work upload the translated file here so that I can add it to the library. The demo project (examples/demo) is quite advanced and applies translation as well. The strings of the demo project are translated in the demo.*.po files.

OK. I'll get to work on it.

(b) Well, the Ini Storage was just an excercise for me to better understand the datastores, it shows that the datastores can be very very simple. For a dedicated database system such as PostgreSQL you better use the SqliteDatastore or ZeosDataastore as a template. I'd guess PostgreSQL could be very similar. Unfortunately I do not have much experience with the big database systems, otherwise I'd already have written more dedicated datastores.

You can avoid writing a dedicated datastore by using the FlexDatastore. See the discussion in the other thread until a special example sample is available within the distribution.

There is also an SQLDatastore (vpsqlds) which appears to be very general and can be adapted by means of sqldialect units. But I though it would be easier to write dedicated datastores and did not yet look into this in detail.

I have no SQL on the clients. They are dumb clients. All SQL is server-side so just sending a JSON string is enough.

(c) The datastore has a property CategoryColorMap in which you can define the descriptions and colors of the 10 predefined categories (so far, it is not possible to change this number). Have a look at examples/demo, it customizes the first two categories.

I'll give it a look.

In addition, I've already seen & tested the Zeos datastore. Great work!

One other question, is it possible to have events in colour in the DayView and WeekView components sort of like Google Calendar events?

JD

« Last Edit: June 30, 2016, 10:13:09 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #3 on: June 30, 2016, 10:28:49 pm »
One other question, is it possible to have events in colour in the DayView and WeekView components sort of like Google Calendar events?
Not at the moment. Could you post a screenshot?

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TVPlanit Reboot
« Reply #4 on: June 30, 2016, 11:19:16 pm »
One other question, is it possible to have events in colour in the DayView and WeekView components sort of like Google Calendar events?
Not at the moment. Could you post a screenshot?

I posted a screenshot of EssentialPIM. Google Calendar events are similar  to this. TV Planit events have a colour left border & white content.
« Last Edit: June 30, 2016, 11:24:24 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #5 on: June 30, 2016, 11:48:43 pm »
TV Planit events have a colour left border & white content.
No, you can change the background color in the datastore's CategoryColorMap. You can also add an icon there for each category. See screenshot of the "demo" project.

These colors, however, are used only in the DayView. The WeekView presents just a list of the events within each day box. I wondered whether it makes sense to have colors here as well - I don't think so.

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #6 on: July 01, 2016, 12:14:43 am »
I am not sure about missing fields, probably there will be crashes at least with the dedicated datastores. FlexDatastore might work because there is a separate assignment of database fields to internal fields. Once I'll be through with the debugging (there are still lots of bugs...) I'll have a look at missing fields. I think it shouldn't be too difficult: it would be sufficient to check the existence of fields on TCustomDBDatastore (unit vpdbds) which is the ancestor of all database-related datastores.
In the current revision the 10 UserFields can be missing without raising an exception. There is no user-interface for adding any data to them in the dialogs provided either. Other candidates for relaxed field handling would the the 5 Custom fields of the contacts, but they do have an input page in the contact editor form. Maybe I'll do this later.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TVPlanit Reboot
« Reply #7 on: July 01, 2016, 12:35:52 am »
I am not sure about missing fields, probably there will be crashes at least with the dedicated datastores. FlexDatastore might work because there is a separate assignment of database fields to internal fields. Once I'll be through with the debugging (there are still lots of bugs...) I'll have a look at missing fields. I think it shouldn't be too difficult: it would be sufficient to check the existence of fields on TCustomDBDatastore (unit vpdbds) which is the ancestor of all database-related datastores.
In the current revision the 10 UserFields can be missing without raising an exception. There is no user-interface for adding any data to them in the dialogs provided either. Other candidates for relaxed field handling would the the 5 Custom fields of the contacts, but they do have an input page in the contact editor form. Maybe I'll do this later.

This is exactly what I planned to do because I don't need the UserFields. The demo looks very good. I'll take a closer look at it.

By the way, how do I print the DayView, WeekView and MonthView? I remember you said tvplanit's printing facilities are very buggy.

Thanks,

JD
« Last Edit: July 01, 2016, 12:40:24 am by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #8 on: July 01, 2016, 09:48:58 am »
how do I print the DayView, WeekView and MonthView? I remember you said tvplanit's printing facilities are very buggy.
A lot of printing-related code was commented in the initial Lazarus port, and the package printer4lazarus was missing. A few days ago I was able to get a print-out, but then postponeed this because I had found severe bugs related to recurring events. Please give me some time.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TVPlanit Reboot
« Reply #9 on: July 01, 2016, 10:04:58 am »
how do I print the DayView, WeekView and MonthView? I remember you said tvplanit's printing facilities are very buggy.
Please give me some time.

Ok. Thanks a lot for your work.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: TVPlanit Reboot
« Reply #10 on: July 01, 2016, 10:14:43 am »
Where you download the tvplanit version you are referring to?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #11 on: July 01, 2016, 10:20:57 am »

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TVPlanit Reboot
« Reply #12 on: July 01, 2016, 10:31:00 am »
Think I found a small bug. In the demo & in my own test program, if I set granularity to 60 minutes and then maximize the window, the DayView vertical scrollbar turns black and unresponsive.

Changing granularity to a different value restores things to normal.

JD
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: TVPlanit Reboot
« Reply #13 on: July 01, 2016, 11:57:03 am »
I installed tvplanit of lazarus 1.6 on mac osx el capitan. Fill the sample successfully (bufdsdatastore), but if you look at the screens that attach there is some bug in graphics. Can you tell me how to solve?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TVPlanit Reboot
« Reply #14 on: July 01, 2016, 07:42:36 pm »
Think I found a small bug. In the demo & in my own test program, if I set granularity to 60 minutes and then maximize the window, the DayView vertical scrollbar turns black and unresponsive.
Fixed.

 

TinyPortal © 2005-2018