Opened 14 years ago

Last modified 8 years ago

#7024 closed defect

No datepicker when create new tickets when GanttCalendarPlugin is installed — at Version 8

Reported by: n.schargitz@… Owned by: Robert Corsaro
Priority: highest Component: DateFieldPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Hey Guys,

i have a problem with these plugin and the GanttCalendarPlugin. When I want to create a new ticket, I could not open the Datepicker. There is no choice to select the Date. I must enter the date manually.

But when I open a already created ticket, I see the option to the right of the testfield, where I can open the Datepicker. These work perfectly!

Can anybody tell me, how I become the datepicker option into the template of new tickets?

Thanks for help

Change History (8)

comment:1 Changed 14 years ago by anonymous

Any field with class="datepick" will get the date picker. The plugin should add the class. What is the name of your new ticket template? Right now it's matching on ticket.html, but perhaps I can make it configurable.

comment:2 Changed 14 years ago by n.schargitz@…

I could not find a ticket template. My co-worker told me, that plugins could not change the origin templates. Where can I find the ticket template for DateFieldPlugin? In the egg? How I change the template? And where schould I add the class="datepick" object?

Thanks!

comment:3 Changed 14 years ago by Robert Corsaro

Your co-worker is wrong. The is a ITemplateStreamFilter interface that allows you to change the template on the fly, using genshi's api. Here is the code that does it:

    def filter_stream(self, req, method, filename, stream, data):
        def attr_callback(name, event):
            attrs = event[1][1]
            return ' '.join(filter(None, (attrs.get('class'), 'datepick')))
        if filename == 'ticket.html':
            for field in list(self._date_fields()):
                stream = stream | Transformer(
                    '//input[@name="field_' + field + '"]'
                ).attr('class', attr_callback)
        elif self.use_milestone and filename in ('milestone_edit.html', 
                'admin_milestones.html'):
            for field in ('duedate', 'completeddate'):
                stream = stream | Transformer(
                    '//input[@name="' + field + '"]'
                ).attr('class', attr_callback)
        return stream

What is happening here is that any input field in ticket.html with a name that matches the list returned by self._date_fields() is getting the datepick class added to it. Also, any field in milestone_edit.html or admin_milestones.html with a name in the list ('duedate', 'completeddate') will also get the datepick class. Later, when the template is actually rendered, the javascript in the plugin will look for fields with the datepick class and add the datepicker to them.

comment:4 Changed 14 years ago by tuokall@…

Keywords: new ticket added

Hello

I confirm this report.

I have similar situation on trac 0.11.5 with ganttcalendar and datefield. When creating new ticket, I don't get datepicker, but it is available when I modify tickets.

comment:5 Changed 14 years ago by Ricky

Same problem here.

comment:6 Changed 14 years ago by anonymous

Priority: normalhighest

I just tried it today, and have exactly the same problem - no date picker on creating a new ticket

(it is available on modifying one)

comment:7 Changed 14 years ago by Maxim Polscha (maxp@…

Trac Release: 0.110.12

I tried to use DateFieldPlugin with trac 0.12. There is no date picker at all. Neither new ticket nor existing one.

comment:8 in reply to:  7 Changed 14 years ago by Ryan J Ollos

Description: modified (diff)
Summary: No datepicker when create new ticketsNo datepicker when create new tickets when GanttCalendarPlugin is installed

Replying to Maxim Polscha (maxp@sterch.net):

I tried to use DateFieldPlugin with trac 0.12. There is no date picker at all. Neither new ticket nor existing one.

That is most likely a different problem that what is discussed in this ticket: there is no DateFieldPlugin on new tickets for an installation with the GanttCalendarPlugin. I'd suggest opening a ticket and providing more information about your installation. It's always a good first step to disable all plugins and see if it resolves this issue. If so, start enabling them one by one until it breaks.

Note: See TracTickets for help on using tickets.