Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

PITS

Summary: PmWiki Issue Tracking System
Version: 0.21
Prerequisites: pmwiki-2.0.beta38
Status:
Maintainer: PM
Categories: Uncategorized

Question

Can I get a copy of the code for PITS -- the excellent PmWiki Issue Tracking System being used for tracking PmWiki issues?

Answer

Yes, if you're willing to accept the caveats that

  • the PITS code itself is not (yet) intended as a generic issue tracking system,
  • it is therefore highly PmWiki-specific,
  • it is largely unsupported until Pm has the time to clean it up, and
  • the code only works with PmWiki 2.0.

That said, here it is:

See below, in the discussion, for newer versions of the PITS recipe.

Do get the status fields each issue page to be displayed on a separate line, you should add this to local/PITS.php:

 Markup('ptv:', 'block', '/^(\\w[-\\w]+)\\s*:.*$/', "<:block,0><div class='property-$1'>$0</div>");

(to build your own data handling tool in pmwiki, see CompareFormsRecipes)

Discussion

Simply copy PITS.php (case sensitive) into your local/ directory, and this will enable the various markups in the PITS WikiGroup. As distributed the code only works in a WikiGroup named "PITS"--again, it was implemented in response to a specific need.

The following markups are enabled:

(:pitsform:)
Display a form to allow a new issue to be entered into the system
(:pitslist:)
Display a list of issues according to various criteria

Comments and further questions should be added below, sent to pmwiki-users, added as issues in PITS, or mailed to pmichaud@pobox.com.

Authors


Implementation

Implementing (:pitsform:) and (:pitslist:) is quite simple and pmWiki.org has some very good examples.
Starting at http://www.pmwiki.org/PITS select the "Edit Page" link and copy/paste the contents to your own page. Then select the different links on that main PITS page to other PITS pages and do the same modifying them to suit your purposes.

These examples are especially beneficial when utilizing (:pitslist:) as it needs to have parameters passed to dispaly in specific manner(s).

I was also able to edit PITS.php in some areas without any obvious problems to make it nicer for my use:

  1. $PitsCategories array you may add and remove items
  2. pitsfield'>PmWiki Version: to my project name and pitsfield'>OS/Webserver/<br />PHP Version: to "Operating System"

Note that if you are using PITS and PerGroupSubDirectories pmWiki must be upgraded to at least pmwiki-2.0.beta38

Feel free to add implementation notes to this section


It just occurred to me that a PITS-style system could be a great way of keeping track of issues/corrective actions in ISO-9001-compliant quality management system. I have used a database for that in the past, but currently we're back to using an Excel-based ("flint axe-based", I'm tempted to say) approach, and I'm not too happy with that.

I'll have to give this some more thought ... :-)

--Henning March 11, 2005, at 09:05 AM

(After some more thinking, I found WikiForms and used them as originally planned. I chose WikiForms over Didier's configurable PITS only because WikiForms provided a nicely written installation guide. I didn't actually compare functionality.)

--Henning May 31, 2005, at 03:29 AM


Since I was looking for this sort of application for a project using a PmWiki site, I had a good look at the PITS code and thought it could be quite easily de-specialized by moving the hardcoded stuff specializing it into configuration vars. So I did.

Here it is: pits-0.20.phpΔ

The configuration is done mainly through template vars, with original PITS config being the default. Pm's original PITS script has only been changed when necessary, for the single purpose of making things configurable. The templates are as raw as possible, so as to be able to configure virtually anything while introducing as little overhead as possible. The de-specialized version should be able to run PITS as well as any other application of the same kind.

History:
  • 0.1 - Initial version released by Pm with the disclaimers above
  • 0.2 - Modifications by Didier Lebrun <dl@vaour.net>:
    • De-specialized the original code (hardcoded -> config vars)
    • Stripped $PageUrl vars in template
    • Allowed space after label ("Label : content")
    • Limited parsing to the PITS header (leave out the comments below)
    • Allowed links in any table field (ex: [[~Author]])
    • Stripped LF and other spaces between HTML lines (avoid vspace)
    • Added HTML entities charset config for some systems (mainly NTFS ?)

-- DidierLebrun March 26, 2005


While using PITS version 0.20, I thought it would be useful to have some sort of WikiTrail based on issues numbers. So I implemented that and made version 0.21 with it,... plus little bits of code cleanup.

Here is the new version: pits-0.21.phpΔ

History:
  • ...[see above]
  • 0.21 - Modifications by Didier Lebrun <dl@vaour.net>:
    • Fixed label parser for i18n charsets
    • Fixed description entry in edit template (LF problem)
    • Transfered default values from edit template to form template
    • Suppressed unuseful $PitsGroup global var
    • Added (:pitstrail[ Pagename|Label]:) markup and assorted function

-- DidierLebrun March 28, 2005


Just a happy user comment !
I just tried Didier's changes. It seems to work great for me, probably this effort to make a more versatile PITS code is a good idea for next version of pmWiki.
Note that filtering criteria work "out of the box" with $EnablePathInfo=1 in your config.php file.
Thanks to all contributors, pmWiki is great !
-- Jacques Rebourcier February 7,2006


Just a little comment
It failed creating the 1st item until I removed the pitstrail from the page before saving. after first save of first page - the pitstrail could be put back...
-- Avi 31-May-2006


Also enjoying PITS and Didier's changes. I think that with the changes, it is a great little pmwiki addition, although with the new great PageTextVariables stuff, someone should eventually update it to use that for easy extraction from pages... but uhhh.... I'm busy right now. :)

But, I will contribute something... after the install, i noticed it hanging up (in my apache error_log i saw errors like "Allowed memory size of 8388608 bytes exhausted"). I took Avi's advice above and changed (:pitstrail:) until after the first issue was created and this fixed the problem.

To do this I had to remove the (:pitstrail:) markup from the $PitsEditTemplateFmt variable. After creating the first issue, i reinserted the markup into my template and also had to edit that first issue page created to put the markup back in as well.

The other issue I had was that the wikitrail wasn't working. After some debugging, it looks like the ListPages function was returning the issues in reverse order (or perhaps no particular order?) which the code assumed was already sorted. I fixed this problem by simply adding sort($pitslist); in the PitsTrail function right after the line $pitslist = ListPages("/^$group\\.\\d+$/");. Users might want to try that if they are using 0.21 and see the trail with no previous or next issues being linked or other funky behavior.

--Lordmundi


If PITS is updated, we may want to change the calls that list the pages to include the length of the issue number so that we are searching for pages that match the issue pattern and not any pages only including digits. This means that ListPages calls that looked like:

 ListPages("/^$group\\.\\d+$/")   (only requires page name to be a number)

would become:

 ListPages("/^$group\\.\\d{".$PitsIDLenght."}$/")  (so if the PitsIDLenght is 5, this would only match pagenames with 5 digits).

-- Lordmundi

P.S. a quick search and replace to fix the misspelling of PitsIDLenght might be good too :)


Categories: Modules
Edit - History - Print - Recent Changes - Search
Page last modified on July 25, 2008, at 11:09 PM