Roundup Wiki

Introduction

In our tracker we have a version table which has a multilink product (linked to a product table). As long as the version and product tables were small, the _generic.index.html page was suitable to maintain the version table. But in time it became harder and harder to maintain it. What we needed was some easy way to add/edit/remove versions and to select the versions that were valid for a specific product.

What does it do?

When adding a version (or changing one by clicking the version name), an other popup appears to let you set (or change) the version name and the products (multi select) for which the version is valid. By default the product selected in the manager is there. At the bottom of the window are an Add button (will be Update in modify mode) and a Cancel button. Pressing Add (or Update) will automatically refresh the version list in the manager.

When removing a version from a product (by uncheck it and pressing Apply), an action handler checks if there are still other products that use it. If not, the version is retired and not shown again.

The database relation

This way the classlist can be used to select more than one version when a bug is solved in more than one release (e.g. HEAD revision for main release and branch revision for patches). Default the classlist can't filter (it hasn't a parameter for it), but you can trick it by misusing the property parameter like this:

In this example, only the versions for product 1 are showed.

The _generic.item.html (or the below version.item.html) template can be used to change version names with still being able to see which products will be affected. Even so can all the needed products be specified directly when creating a new version. This prevents having to add a new version manual to each product.

The _generic.index.html template will give a quick overview which versions there are, and for which products they are valid. The version/product classes

Product table::

Version table::

Now we have our scheme complete. What's left is adding the HTML templates and the action handler.

The HTML templates

In total we need three HTML templates: 1. version.manager.html This template is the basis for the version manager. It contains an inline frame that will hold the version listing.

version.manager.list.html This template is loaded in the inline frame of version.manager.html.

version.item.html (optional) This template is used to add or edit a version. The template is not really needed. You might let roundup use the default _generic.item.html template.

version.manager.html::

version.manager.list.html::

'scrollbars=no,resizable=no,location=no,directories=no,menubar=no,toolbar=no,status=no,height='+height+',width='+width+extra);

version.item.html (optional)::

The style sheet

The manager mainly uses the classhelp styles. Ony some additional body and iframe styles are needed::

The action handler

We need an action handler to update the selections in the database tables.

In interfaces.py we add a VersionManager class::

And finally we make the new handler known to roundup in 'interfaces.py'::

Finally

To use the version manager, you have to call it somewhere in page.html. One location could be below the Add User anchor tag in the Administration block. The version manager is supposed to run in a popup window, but that can easily be changed. The advantage of a popup window will be adding a version while the issue.item.html template is still visible.

The call could look like::

We our self placed the javascript function popup function in version.manager.list.html into a separate javascript file and include it where needed. The call then look like:

Unfortunately, roundup doesn't support a direct method of displaying only those versions that are valid for a selected product without some handwork.

There are two handwork methods to do this:

You can show all versions and use an auditor to check if the version is valid for the selected product. This works, but the users will see a long list of versions with only same that are relevant for them.

You can add a product select form to pre-select a product before filling in the issue.item.html. To my opinion, this is the best (and hardest) way. There is an example of such a pre-select form in the customizing document.

After pre-select, the HTML to filter the versions could look like::

That's it! I hope you like and have need for it. At least my boss did ;-)

Best regards, Marlon