Roundup Tracker

This idea was taken from a roundup users mailing list message posted by RalfSchlatterbeck. It adds a new link, close to the submit button, that launch a Create New Issue page filled with the current data already filled.

Edit the issue.item.html template. Look for the table cell:

<td colspan=3 tal:content="structure context/submit">
 submit button will go here
</td>

and after it add the following cell:

<td tal:condition="context/id">
  <a i18n:translate="" tal:attributes="href python:
     'issue?:template=item&' + '&'.join
     ([ '%s=%s' % (i [0], i [1]) for i in
       [ ('title',      context.title)
       , ('priority',   context.priority)
       , ('assignedto', context.assignedto)
       , ('topic',      context.topic)
       , ('@note',      'This is a fork of issue'+context.id)
       ]
      ]
     )">
  Copy item
  </a>
</td>

That's it. Actually this snippet implements a fork rather than a strict cloning because it does not copy back history.

By the way, you may also want to edit the submit button cell and change``colspan=3`` to colspan=2.

RalfSchlatterbeck: I just found out in my tracker, that in the URL the title etc. should be quoted in the URL. So instead of

([ '%s=%s' % (i [0], i [1]) for i in
...

we quote the second part:

([ '%s=%s' % (i [0], utils.urlquote (str (i [1]))) for i in
...

and in some extension module, you should get the urlquote method from urllib.quote:

def init (instance) :
    from urllib import quote
    instance.registerUtil ('urlquote', quote)