I'd like to see the projects date start and end use the [[http://drupal.org/project/date | Date API]]. This would provide the ability to create views according to project due dates or project start dates. This would also allow for views of projects [[http://drupal.org/project/calendar | on the calendar]]. I expect it would improve the flexibility of the dates as the gantt charts feature comes forward in the list.

This would bring with it the dependency on CCK and Date modules, but those are getting to be so common...

For now, I think I can assimilate this by hiding the current stuff at the theme layer and creating the CCK types. If anyone has better solutions, I'm game for hearing them. :-)

Comments

Roberto Gerola’s picture

>This would bring with it the dependency on CCK and Date modules, but those are getting to be so common...

Sorry, no mandatory dependency to other contrib modules,
but it has a sense to integrate these features as optional dependencies.

Thanks, Roberto.

flickerfly’s picture

An optional dependency sounds like a fine idea.

Magnity’s picture

Marked #374550: Date entry as a duplicate of this issue.

socialnicheguru’s picture

Component: Code » Storm.module

This would be a great idea.

I would love to then use date api and all the calendar features to then map workflow tasks and ticket duration to a calendar.

I am stuck right now trying to figure out how to make dates available.

design.er’s picture

Subscribe. I'd be glad to help to test this feature and report everything back to the community.
After this feature request is 9 months old, is there a target when it should be ready?

Thanks for your work! Really appreciate it! :)

homoludens’s picture

is this still relevant?
Now there is support for using date fields in views I don't see the point, or am I missing something?

I have made changes in project and task module to use date_popup calendar instead 3 selection boxes. It is kind of overkill to use date_api only for that, but is very important for usability.

If someone wants it, i can make a patch.

Magnity’s picture

There is the advantage that using the Date API, items can be added to a calender (see #4), but I will not commit anything that introduces a non-optional dependency without a good chat about it first.

design.er’s picture

I really need this since my client said that he would like to see his projects in the calender. In my case I have no other way than using a date field as views arguments. So, if it is possible a patch or sub-module would be awesome. :)

Thanks a lot for your work. I appreciate it! :)

Magnity’s picture

Your best bet is a patch for your installation then - whenever I see the word 'client', it seems that timescales always become much shorter, and it'd be unlikely that we'd get something out in a stable release soon enough for your client.

design.er’s picture

Basically you're right: Timescales always become much shorter :)
In this case we have till end of august. Of couse it would be great if'd get this feature sooner but don't stress you.
Generally it would be really great if you could realize this.

Thank you! :)
Stefan

homoludens’s picture

Status: Active » Needs review
StatusFileSize
new2.76 KB
new2.79 KB

Here are mine patches. dependencies are date_api and date_popup - but are totally optional ( I also like "No mandatory dependencies" approach, but if something could be useful let it be optional) and if you don't have date_api everything works the same. If you have it you will have date_popup for choosing dates in project and task - and can use those fields in "Calendar" view style as fields and arguments.

Important: If you use some date field as argument you have to put it in "Fields" list too. You can use "Exclude from display" if you don't want to see it - as you probable don't - that's what calendar is all about. For more information please see: #488854: Calendar doesn't display nodes without a date Field in the View

Magnity’s picture

Would it be possible to use dd-mmm-yyyy for the dates?

homoludens’s picture

I was hopping for the same. But for some strange reason that format is the only one date_popup wonted to show.
I'm looking for problem and solution ( #509036: Default date and date popup in a custom module) because this format is pretty strange.

Magnity’s picture

Status: Needs review » Fixed

OK that's committed then. We'll get that format changed once date api allows it.

design.er’s picture

It works absolutely fine for me.

I don't know how the Date integration works but is it possible to integrate beside the Date fields also the Time fields - at least for tasks? So it would be possible show the start and end time of a task in the calendar.

Marko, thank you very much for your work! I really appreciate it! :)

Best regards,
Stefan

design.er’s picture

Another small point: The standard "end" date in the add/edit mode of a project and task is always the 01.01.1970 altough I set the range of date between 2009 - 2015 in the Storm settings.
Is it possible to correct that? ...for example to set the "end" date to the same value like the "start" date - so the user won't have to correct the month and year every time?

Regards,
Stefan

homoludens’s picture

@design.er
You are welcomed :)

it is possible to use it for time also, and i will probable do it. just can not right now, but soon - this was only test, and since it is working fine I will do it. And I'm thinking to use something like http://haineault.com/media/jquery/ui-timepickr/page/#d-demo-wrapper-1 . Becouse I can not find some timepicker in date_api, or I'm missing it.

I have noticed problem with end date and solution is simple:

in file stormtask.module in function stormtask_form(&$node)
find

  if (arg(1)=='add') {
    $node->datebegin = time();

and just add line $node->dateend = time();. so you will have:

  if (arg(1)=='add') {
    $node->datebegin = time();
    $node->dateend = time();

same code and the same change is required in file stormproject.module in function stormproject_form(&$node)
and end time will, at least be current date.
I have idea to make end date the same as start date - and maybe to limit it's calendar to dates further from start date. but, currently that is only idea.

design.er’s picture

Now it works great for me.
IMHO a timepicker is not needed. I think something similar to the time field from the date module would be enough. But that's just my opinion. :)

Thank you very much for help! :)

Magnity’s picture

Status: Fixed » Active

I've just committed the change to the dateend default value.

This also seems to ring similar to the discussion @homoludens and I had in #297775: gantt charts & dependencies where we talked about getting rid of the date end field input and simply calculating it from the date start and duration.

Marking as active so that issue doesn't disappear whilst we're working through these last bits.

homoludens’s picture

Status: Active » Needs review
StatusFileSize
new2.11 KB

Yes we talked about that. Mine idea was to leave "Date begin" and "Date end" - and to calculate duration. And I have created a patch for that, but now I'm not sure if I have it posted somewhere... if I have, here it is again for review.

It is a patch against stormtask, with function for calculating duration function _storm_get_duration($start_date,$end_date). it can easily be implemented for project, or any other date begin - date end field.

In that case, good place for that function is storm.module, so it would be accessible for all modules without stormtask dependency.

Mark_Watson27’s picture

I think the code needs changing slightly to check if you have the date_popup as well as date_api, otherwise you won't see the date fields.

storm/stormtask/stormtask.module:

function stormtask_form_alter(&$form, $form_state, $form_id) {
  if (module_exists('date_api') && module_exists('date_popup')) {
Magnity’s picture

Yes - that's right, i've changed that for in both the project module and task module.

A summary of where this issue is at now:
- If Date API and Date Popup are enabled, the date fields can be selected from a neat popup.
- Ideally would show dates in the format dd-mm-yyyy once the issue with date api is fixed.
- Needs to be able to show start / finish time for tasks.

Regarding the whole start date / end date / duration - my opinion is that the way to keep the consistency is probably best by calculating the end dates from the start date and duration - this way one can move the event in time without altering the listed duration. However, i'd really like a few more people to put their 2c in on this.

Mark_Watson27’s picture

You could check to see which fields have been filled in
i.e.
If Start and End provided then calculate duration
If Start and Duration provided then calculate End
If End and Duration provided then calculate Start

Magnity’s picture

Status: Needs review » Fixed

This issue was getting a little lost...

I've created new issues for the two remaining issues:
#569430: Ensure consistency between start / end / duration fields
#569432: Add fields for start / end time selection

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.