Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
taskfreak.com
Pages: [1] 2 3 4 5 ... 21
  Print  
Author Topic: Time Clock  (Read 72233 times)
barbs770
Beta Tester
Lionfish
****
Posts: 87


« on: September 27, 2006, 03:43:35 PM »

This mod lets you log the time it takes to complete each task. A stop/start button column was added between "Deadline" and "Comments." The total time is calculated and displayed to the right of the button. It is shown as Hours:Minutes:Seconds (HH:MM:SS).  If more than 24 hours have been logged, the number of days will appear as well (Dd HH:MM:SS). The total time is also a link to the history tab where you can view each of the logged time segments and who logged it. Administrators and task owners can also reset the time to 00:00:00.

Download the Time Clock Files for TaskFreak Multi User 0.4.2:
http://www.albrookdata.com/portfolio.php

View a demo before you download:
http://www.albrookdata.com/portfolio.php

Screenshot:



A Few Notes:

- You'll need to create a new database table. The query is in the README file.

- The javascript timer that counts off the seconds may be slightly off from the stopped time. The stopped time (total time) is correct and calculated directly from the database.

- If you log more than 31 days of time, the total time will not display accurately. Javascript is limited to extracting the day of the month from a date...31 days per month. It would be nice if it gave me the numbered day of the year. If you know a way to do this, let me know.

- I need help with the German, French, Dutch, and Italian translations for the following phrases (thanks in advance!):
     "Total Time"
     "Reset time clock to 00:00:00 from" (current total time, i.e. 04:54:12)
     "time clock has started"
     "time clock has stopped"


If you see any major problems with the time clock or if you know any way I can make it better, just let me know. It's my first open source modification. yay! Smiley

Enjoy,
Barb
« Last Edit: October 03, 2006, 12:30:42 PM by barbs770 » Logged
stan
Administrator
Hammerhead shark
*****
Posts: 1077



WWW
« Reply #1 on: September 28, 2006, 12:54:14 AM »

Brillant!!!!
Logged
PowerProgramme
Batfish
**
Posts: 25


« Reply #2 on: September 28, 2006, 04:29:34 AM »

Ah, Time-O-Status has arrived Wink
Logged
barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #3 on: September 28, 2006, 11:16:49 AM »

Wow! Thanks for the link from the home page! I'm honored. Smiley
Logged
Searcher
Global Moderator
Hammerhead shark
*****
Posts: 1766



WWW
« Reply #4 on: September 28, 2006, 04:12:19 PM »

Quote
- If you log more than 31 days of time, the total time will not display accurately. Javascript is limited to extracting the day of the month from a date...31 days per month. It would be nice if it gave me the numbered day of the year. If you know a way to do this, let me know.

Barbs,

I am sure I could work out some brutal javascript code to determine the day of the year, but why don't you just simply pass the number from php to javascript every time you refresh the page?

Code:
DayOfYear = '<?=date("z")?>'
Logged

barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #5 on: September 29, 2006, 11:01:14 AM »

Hmm..I guess I could do that.

Well, I'm not passing a date to javascript. I'm passing the number of accumulated seconds. In javascript, I create a date by adding those seconds to January 1 1970 00:00:00 GMT (the beginning of time)...and then I can extract the days, hours, minutes, seconds. Doing it this way makes it easier to add one second and increment the timer.

BUT I could check the number of days from the accumulated seconds and pass this to the javascript. I wouldn't need php at all and there would be no limit to the number of days it can log. My original idea was if Javascript could tell me the numbered day of the year, then the counter would only be limited to 365 days (or 366)...but it would still be limited.

I'll work on this and get back to you. Thanks for the idea Searcher! And thanks for letting me think out loud...

Logged
barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #6 on: September 29, 2006, 11:58:02 AM »

Ok, I've updated the code. There is no longer a 31 day limit. You can log as much time as you want...even years! Although, I'll warn you now it won't calculate years. If you need that, you may want to break down your projects into more attainable tasks. Wink

Thanks Searcher...it only took 3 lines of code.

Download the new code:
http://www.albrookdata.com/taskfreak/TimeClock_0.4.2.zip
Logged
Searcher
Global Moderator
Hammerhead shark
*****
Posts: 1766



WWW
« Reply #7 on: September 29, 2006, 02:38:53 PM »

Ok, i can see now where are you going with this.. tested it and works nicely, dind't know why do you need a new line for each start/stop, but i found the stats!
RE years: hahahahehehe, i doubt anyone would like years, but how about weeks? /7 Smiley

So what's the next plugin you're going to make

Small details:
There is a js bug on line 578 in freak.js ~ ei has no properties
you need to move the
Code:
ei.innerHTML = "";
one line below or just remove it Smiley

Also you can replace all
Code:
document.getElementById
with
Code:
gE
since it's defined at the beginning.


I am thinking of making a plugin for managing external plugins Wink to avoid code rewriting every time one or the other side makes an update..
« Last Edit: September 29, 2006, 02:45:20 PM by Searcher » Logged

barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #8 on: September 29, 2006, 03:43:58 PM »

I could add weeks and drop the seconds. The problem is that I don't want to take up too much space. I don't believe seconds are necessary, but it made it easier to test the javascript timer...I didn't want to wait in minutes. Wink

Small details:
There is a js bug on line 578 in freak.js ~ ei has no properties
you need to move the
Code:
ei.innerHTML = "";
one line below or just remove it Smiley

Also you can replace all
Code:
document.getElementById
with
Code:
gE
since it's defined at the beginning.

Yeah, that line wasn't necessary...I just deleted it.


I am thinking of making a plugin for managing external plugins Wink to avoid code rewriting every time one or the other side makes an update..

That would be really handy. I have some other projects to finish up so I don't have any plans for any more plugins right now. Maybe you'll have the external plugin done by the time I get back to writing another one.
Logged
Searcher
Global Moderator
Hammerhead shark
*****
Posts: 1766



WWW
« Reply #9 on: October 02, 2006, 09:23:19 PM »

Naah, seconds are cool, make you work faster Wink

I have a small bugfix 4 u again in freak.js
Code:
function freak_time(id,clockId,isRunning,totalTime) {

add line
Code:
var skin;

This fixes js error in IE, but obviously noone here uses it Smiley

Also one more thing for other browsers, in index.php
Code:
<a href="javascript:freak_time
add blur
Code:
<a onclick="this.blur()" href="javascript:freak_time

I use Maxthon and the focus stays on the button...
Logged

barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #10 on: October 03, 2006, 12:29:44 PM »

Ok, Thanks! I've fixed those bugs in the latest version, and I decided to start making better use of the versioning numbers. For minor bug fixes, I'll increment the last digit. The latest is version 0.1.2 and you can download it here: http://www.albrookdata.com/downloads/TimeClock_0.1.2.zip
Logged
barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #11 on: October 17, 2006, 12:15:15 PM »

Another update...Version 0.2.0

- Files are for Multi User 0.5.1
- Added "time" tab to View Panel, which shows total time recorded for each user. (History tab still shows individual time records.)
- Fixed date sort in History tab.

Download and Demo are in the same place:

http://www.albrookdata.com/portfolio.php

** Still need help with translations (I have eng. and span.)! Any help would be appreciated! **
Logged
stan
Administrator
Hammerhead shark
*****
Posts: 1077



WWW
« Reply #12 on: October 17, 2006, 02:38:23 PM »

Are the files in pt/ folder actually spanish?
I'm confused now...
Think i might have messed things up a bit...
Logged
barbs770
Beta Tester
Lionfish
****
Posts: 87


« Reply #13 on: October 17, 2006, 03:04:09 PM »

I showed my friend Jose the es/freak.php file from 0.4.2 and he said it was all spanish. Then, I showed him the pt/freak.php file from 0.5.1 and he said it looks like a mix of portuguese and spanish.

I wish I could be of more help. I recently moved to Panama but my Spanish is terrible. Does anyone speak Portuguese?
Logged
stan
Administrator
Hammerhead shark
*****
Posts: 1077



WWW
« Reply #14 on: October 17, 2006, 04:48:41 PM »

Aaarg... I can't do anything to fix this since I know none of the languages...
Logged
Pages: [1] 2 3 4 5 ... 21
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Darkz Theme By [S.W.T]