Motivation
Develop a contrib module that will allow Time Tracker module to update/create a storm timetracking node.
Proposed resolution
A function to create a storm timetracker node that would be triggered when time_tracker_time_entry_submit() is executed.
Remaining tasks
Populating of Activity list from the storm attributes if possible.
User interface changes
Enable this functionality check box somewhere in timetracker admin form.
API changes
None as far as i understand.
Note.
//TODO: Will attach the proposed patch and module in the follow up comment once i get the issue number.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1264654-6-time_tracker_storm_update.patch | 386 bytes | d34dman |
| #8 | 1264654-#6-time_tracker_storm_update.patch | 386 bytes | d34dman |
| #6 | time_tracker_storm_update.zip | 7.72 KB | d34dman |
| #6 | [1264654]-[#6]-time_tracker_storm_update.patch | 386 bytes | d34dman |
| #4 | time_tracker_storm_update.zip | 1.91 KB | d34dman |
Comments
Comment #1
d34dman commentedComment #2
d34dman commentedthe above code has security vulnerability as it doesn't do validation of data before node_save().
Comment #3
drclaw commentedI can't view the patch. Goes to a page not found page.
Comment #4
d34dman commentedUpdating files. Code cleanup has been done in the module file. Please ignore the files in comment #4.
EDIT NOTE: i meant ignore files in comment #1. Sorry for the confusion.
Comment #5
d34dman commentedDear drclaw,
i think if you expose the $time variable in your function
function time_tracker_time_entry_submit($form, &$form_state)in "time_tracker.module" file, those who want to save the data into custom tables ( like the one am trying to do) would be able to use it.Possibly some hook if implemented in our custom module will be invoked. Thus all you have to do is
module_invoke_all( '[hook_name]', $time );after you have updated your tables infunction time_tracker_time_entry_submit($form, &$form_state).A similar hook for deleting and updating can be decided upon.
NOTE: For some reason that i dont know my patch files are not being uploaded properly. So am pasting the patch file that was uploaded in comment #4 here.
Comment #6
d34dman commentedIf this small patch is committed into the latest dev, then i can carry out further developement of the module, maybe as a separate project.
Comment #7
drclaw commentedI think the problem with your patch might be the square brackets in the filename?
Either way, I can't commit the patch in commen #5 as it uses a function from another module that isn't a dependency of time tracker. However some sort of hook implementation could be possible in the near future...
Comment #8
d34dman commentedthe patch in comment #6 actually calls a module_invoke_all('hook_name', $time);
Attaching the patch mentioned in comment #6 without the square brackets. Hopes it works.
Just in case it doesn't am pasting the patch here below.
Comment #9
d34dman commentedNoops the above patch wont show up cause of this #284899: Drupal url problem with clean urls.
Renaming the patch file again.
Comment #10
d34dman commentedHi, i have created a sandbox project that is waiting for the patch to be commited .
This is the path to the sandbox project.
Thank you.
Comment #11
d34dman commentedany updates?
Comment #12
drclaw commentedD34dMan
I haven't had a chance to do this just yet. I want to incorporate some hooks into time tracker, but I haven't had the time to fully think it through yet.
I'll let you know as soon as I get a chance to work on this.
Thanks!
Comment #13
d34dman commentedi appreciate your willingness to include some hooks.
Will be anxiously waiting for its release. Thank you.
Comment #14
codi commentedHey D34dMan,
drclaw is off on holidays for a while so I'm diving back into time_tracker. I'm going to review the patches and code you've attached here and see what I can come up with.
Comment #15
d34dman commentedHi codi Welcome,
Time tracker integrates nicely with atrium and i can see it plays well with case tracker too.
I think there might be people (like me) who want to use timetracker with other project management application. It would be a nice feature to include a hook like what i had proposed earlier (#9).
If some hook like that is implemented, i could use a hook like that to update Storm using Time tracker storm update
Thank you.
Comment #16
drclaw commentedWell... it's about 9 months later, but I finally added a couple hooks to time tracker. There's two hooks: hook_time_tracker_time_entry_presave() and hook_time_tracker_time_entry_save(). Presave is before the record is saved to the db, and save is after it's been successfully saved. Hopefully nothing else got messed up in the process of adding these. I actually had to do some form array restructuring to make this work (or at least make it easier to do). Technically I also added a couple api functions for saving and deleting time entries instead of doing that directly in the submit handlers. =)