Hi,

Saint Germain wrote:
> Indeed we should not remove the <div id="banner"> inside theme.html
> otherwise filter_milestones.js script is not inserted (took me a while to 
> figure
> that out).

If you're on a newticket or change-ticket page, Filter_milestone.js switches 
the content of the milestone-, component- and version-comboboxes depending on 
the value selected in the project combobox.

It's inserted here in the html stream:

    def filter_stream(self, req, method, filename, stream, data):
        if filename == "ticket.html":
            # replace "project" text input (lineedit) for ticket editing with a 
selection field
            filter = Transformer('//input[@id="field-project"]')
            ticket_data = data['ticket']

            script_filter = Transformer('//div[@id="banner"]')

            stream = stream | 
filter.replace(self._projects_field_ticket_input(req, ticket_data))
            stream = stream | 
script_filter.before(self._update_milestones_script(req))

        return stream

    def _update_milestones_script(self, req):
        script = tag.script(type="text/javascript", 
src=req.href.chrome("simplemultiproject", "filter_milestones.js"))
        return script



>
> However it seems that I am also missing something because whatever I
> make, I never got any errors because of missing project value.
> For instance I can see in SimpleMultiProject ticket.py a message ""Please,
> select a project!" in the function _add_milestones_maps but I haven't
> managed to trigger it.
>
> In particular I can create a ticket without any project and I can create a
> milestone without an project.
>
> Is there something else I have forgotten in order to have a good integration
> of SimpleMultiProject ?

By default, SimpleMultiProjectPlugin does not force you to select a project on 
ticket creation, because in some cases you may find it useful to capture a 
problem in a ticket before you decide which project is responsible. In spite of 
this, you have "Please, select a project!" on milestone selection. The idea is 
here that you cannot have a milestone without project, and I simply wanted to 
prevent the quite frequent situation that lazy users forget to fill out the 
project field in case of when they select a milestone.

Though, when I try to create a ticket without selecting a project, it denies 
the creation with "Warning: The ticket field 'project' is invalid: project is 
required", because here we don't want tickets without projects. I've installed 
TicketValidatorPlugin for that and configured in my trac.ini the following:
[ticketvalidator]
new.required = project

I hope that helps,

CU, F@lk

----
R&D Software
Baumer Optronic GmbH
www.baumer.com



Gesch?ftsf?hrer: Dr. Albert Schmidt* Dr. Oliver Vietze
Sitz der Gesellschaft: Radeberg
Amtsgericht Dresden: HRB 15379
Ust. ID: DE 189714583


-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to