- 🇺🇸United States m.stenta
I dusted this off and pushed an updated
2.x-time-qty
branch to the fork. It takes the branch that @paul121 started 2 years ago and just makes a few small changes (for consideration):- Updated the module description to make it clear that this is designed for time tracking.
- Updated the module dependencies to bring them in line with recent changes in farmOS core to our other quantity type modules.
- Removed the "Notes" field from time quantities. I suggest we punt on this for now and consider it in a follow-up if there is a need for it in practice. Easier to add to this data model in the future than remove from it, so let's start simple. Perhaps the
label
field will be sufficient to start. - Removed the time quantity template. We refactored some of the way this works since this branch was created, and none of the other core types provide a template anymore (they used to). It might be worth considering it again, but it seems OK without the extra code to start.
- Hide the start and end time fields in both the form and view displays. In my mind these really should only be used internally for storing the current state of clock-in/out, and ideally wouldn't be exposed to the end-user. They are necessary for UI to be built that allows for clocking-in/out, but exposing them directly in the form/view display UI only makes these quantities more confusing and prone to data issues I think. Ultimately the quantity
value
is the important piece of information, and will store the total time tracked, which will be calculated by the start/end in cases where the user clocked-in/out. But without that auto-calculation logic in place, I don't think it makes sense to expose these to the user.... not yet at least.
I think overall this probably still needs some minimal UI/UX work before we merge it. We may want to consider hiding the "Measure" field and setting it to
time
automatically. We did something similar withprice
quantities, and had some core logic to make that easier, but then removed it here IIRC: #3324839: Refactor price quantity data architecture →We may also want to add the quantity value auto-calculation logic at the data level... so that if a time quantity is saved, and start and end times are provided, the value is filled in automatically. Or we could defer that to UI/UX level logic. Up for debate... and the answer to this might become more clear once we have some UI starting to be built out that uses this data model.