Modify

Opened 4 years ago

Closed 2 years ago

#7024 closed defect (invalid)

No datepicker when create new tickets when GanttCalendarPlugin is installed

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

Description (last modified by rjollos)

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

Attachments (0)

Change History (11)

comment:1 Changed 4 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 4 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 4 years ago by doki_pen

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 4 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 4 years ago by YouLi

Same problem here.

comment:6 Changed 4 years ago by anonymous

  • Priority changed from normal to highest

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 follow-up: Changed 4 years ago by Maxim Polscha (maxp@…

  • Trac Release changed from 0.11 to 0.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 4 years ago by rjollos

  • Description modified (diff)
  • Summary changed from No datepicker when create new tickets to No 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.

comment:9 follow-up: Changed 4 years ago by hisamitsu

I have the same here.

  • Trac 0.12
  • TracDateField 1.0.1
  • Another Plugins
    • TracGanttCalendarPlugin 0.1
    • TracSubTicketsPlugin 0.1.0
    • TracTicketDelete 2.0

Creating new ticket, the datepicker doesnt work (i cant see the button and the popup dont open).

When modifing to acept the ticket, it WORKS fine.

After that, the datepicker doenst work again.

Also, my gantt calendar dont work anymore.
I just see the tickets created before install the datepicker.

Any sugestion?

tks.

comment:10 in reply to: ↑ 9 Changed 3 years ago by rjollos

Can someone open the Error Console (Firefox) for one of these installations and see if there is anything relevant there?

comment:11 Changed 2 years ago by rjollos

  • Resolution set to invalid
  • Status changed from new to closed

Closing this because there has been no follow-up for months, and the changes would likely need to be made to the GanttCalendarPlugin, not the DateFieldPlugin.

Feel free to reopen or add additional comments if you think there is another way to go here.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from doki_pen. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.