// using curTask + lastCommit decide what to do.
this.inQuery = 0;
//tests:::
- this.verifyTaskTime();
- this.verifyTaskProject();
-
-
-
-
- },
-
- verifyTaskTime : function()
- {
+
// check to see if current task is being planned for too long..
// you should only enter task, and allow it to span over an hour.
// if you do the whole day on a task, then it will need to verify with you every so often that you
*/
- var now = new Date();
- if ( this.curTask) {
- print(JSON.stringify(this.curTask));
-
- var endoftask = this.curTask.action_datetime.add(Date.HOUR, this.curTask.qtyvalue);
- print("END OF TASK: " + endoftask);
-
- var max_stretch = now.add(Date.HOUR, 1);
- print("Max stretch: " + max_stretch);
- if (endoftask > max_stretch) {
- this.fixEndCurrTask(); //
-
- }
+
+ if (!this.currTask) {
+ this.promptForTask();
+ return;
+ }
+
+ if (!this.currTask.project_id) {
+ this.promptForTask();
+ return;
+ }
+
+ // are we working on the same project!!!!
+ if (this.currTask.project_id != this.commitRepo.project_id) {
+ this.promptForTask();
+ return;
+ }
+
+ // has the ticket been closed...
+
+ var is_project= this.curTask.project_id_code[0] != '*' ;
+ // is there a ticket?
+ if (is_project && !this.currTask.ticket_id) {
+ this.promptForTask();
+ return;
+ }
+ if (is_project && this.currTask.ticket_status) {
+ //TODO - if status is closed.. then we need to prompt..
}
+ // we now working on same project..
+
+
+ var now = new Date();
+
+ print(JSON.stringify(this.curTask));
+
+ var endoftask = this.curTask.action_datetime.add(Date.HOUR, this.curTask.qtyvalue);
+ print("END OF TASK: " + endoftask);
+
+ var max_stretch = now.add(Date.HOUR, 1);
+ print("Max stretch: " + max_stretch);
+ if (endoftask > max_stretch) {
+ this.fixEndCurrTask(); //
+
+ }
+ // still needs to be verified..
+
+
}
+ // ok verified basic time...
+ //let's check to see if project matches..'
+
},
+
+
+
//---------- end verifying - now prompting..
var reot = Date.parseDate(eot.format('Y-m-d H:') + (min ? min : '00') + ':00', 'Y-m-d H:i:s');
print("REAL END TIME" + reot.format('Y-m-d H:i:s'))
- print("Current start time" + his.curTask.action_datetime.format('Y-m-d H:i:s'))
+ print("Current start time" + this.curTask.action_datetime.format('Y-m-d H:i:s'))
// how long between start and reot...
var hours = (reot - this.curTask.action_datetime) / (60*60 * 1000 );
var rounded = Math.round(hours * 4) / 4.0;
print("Rounded : " + rounded);
+ //return;
this.updateTask({ qtyvalue : rounded });
-
+ this.curTask.qtyvalue = rounded;
},