PDA

View Full Version : automatic begin date for a new dependent task


gmurillo
01-06-04, 08:39 AM
Hello I'm trying to to make easier the way you register tasks. When a project have a lot of tasks it is easy to get confused with the dates.

I've looked to the code when yo create a new task, You have a combo-box that is this:

<select name="task_parent" class="text">
<option value="" selected="selected">None</option>
<option value="137">Tara 1</option>
</select>

And you have two elements that have the start task date

<input type="hidden" name="task_start_date" value="" />
<input type="text" name="start_date" value="" class="text" disabled="disabled" />

1) create some hiddens of the ending date of the tasks listed in the combobox.
2) put an onchange event that when you chosse one parent task you automaticly put the value of the date of the new task, and let the posibility for the user to change it with the calendar.

żIn which file do I have to make the changes?

Thanks

nitroushhh
02-06-04, 05:40 AM
Hi,
The update/add task code is in...
/<base>/modules/tasks/addedit.php
this line near the top picks up the existing start date...
$start_date = intval( $obj->task_start_date ) ? new CDate( $obj->task_start_date ) : null;
But the project is read a few lines further down so things need moving around a bit.

There might be a patch for picking up task start date up from the project. It seems familiar.

well have fun.

ps. are you Spanish ? How do you get the inverted question mark from the keyboard ???

gmurillo
11-06-04, 01:10 AM
Thanks for your help. Know I made that when de user add a dependence task (one or more) the start date of the new task is one day before the largest dependence task. I used some hiddens to have the end date of all the tasks of the project. Then I put some extra code in a JavaScript.

But Know I want that the aplication don´t take holidays, żIs there a table or a place where I can tell de aplications which days are
holidays?

Thanks :)

ajdonnison
11-06-04, 09:23 AM
Not at the moment, although it would be relatively easy to implement. One concern is that holiday tables get out of date very quickly and there is no established "global" holiday regime. E.g. Queen's Birthday holiday in Australia occurs on different days in different states. Australia doesn't celebrate Lincoln's Birthday (why anyone would celebrate the birthday of an automobile I don't know ;), and only Australia and New Zealand celebrate ANZAC day. So the table would have to be maintained by the site admin. We probably couldn't even put in some "standard" dates like Christmas, without also putting in Ramadan and Yom Kippur (sorry if my spelling is wrong).

As long as the site admin was OK with this, and maintained it every year as dates do change, then it should be fine. I don't see a problem in providing the feature. The only comment I would make is that admins tend to set these things up once, then turn off the feature as they find the dates drift during successive years, and they can't be bothered maintaining them.

cyberhorse
11-06-04, 03:14 PM
surely an automatic process can be done ... a google for free information on holidays and a good parser should do it no?

ajdonnison
11-06-04, 03:34 PM
Don't know. If it is possible I'm sure a member of the community will figure it out.

bleemer
19-06-04, 01:13 AM
:idea: Hey guys - I too would really like to have dotProject automatically calculate the start date of a dependent project...
What about posting your code with some instructions or creating a patch?
I'm sure I'm not the only one who would find this a great feature!