Ismailtaktak / freemedforms

Automatically exported from code.google.com/p/freemedforms
Other
0 stars 0 forks source link

AvailabilitiesModel crashes when deleting all availabilities and creating new. #247

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Normally it is not allowed to delete all availabilities. the UI complains when 
deleting the last day - even if this day has NO availability any more.

try the following:

open user manager, go to any user -> agenda -> availabilities.
delete ALL you can delete, the last day is not allowed (even if there is no 
timerange in it any more).

now save, go to another user, go back to the last user ->availabilities.
you see: "No availabilities" - which should not happen anyway.

Now press the "add" button -> FMF crashes wich a segfault.
usercalendarmodel.ccp, line 489

this could be easily fixed, but I suggest another solution.
Instead of having a tree where the day is also an item that is created, let the 
model automatically create ALL days.
* The Days of the week are in existence *anyway*, no matter if someone has an 
availability on that day or not.
* Then, if you create an availability, create it for one day.
* Let the user delete even the last availability. why not. fix that segfault.

eric, if you are d'accord, I'll take this for a quick reworking, and implement 
"modify availability" too.

Original issue reported on code.google.com by christian.a.reiter@gmail.com on 19 Dec 2012 at 11:10

GoogleCodeExporter commented 9 years ago
ah, and add/remove buttons should be enabled/disabled.
clicking on remove when nothing is selected crashes FMF too.

Original comment by christian.a.reiter@gmail.com on 19 Dec 2012 at 11:45