Extension talk:IssueTracker

From MediaWiki.org

Jump to: navigation, search

Contents

[edit] Clif's Issue Tracker Hacks - Nov 12, 2009

Here are a bunch of field and functionality changes I have developed for Issue Tracker in order to make it better fit my needs. Some of these directly address previous functionality requests, and some are just things I wanted the tool to do. I hope you find them useful.

--Clif 10:29, 13 November 2009 (UTC)

[edit] Hack #1: Remove Lowercase Group Name Restriction

If you'd prefer not to have the extension dictate your group names, go to the hasPermission function in IssueTrackerAction.php and change

if ($group == strtolower($perms[$action]['group'])) {

to

if ($group == $perms[$action]['group']) {


[edit] Hack #2: Adding Fields (Priority and Severity)

I'll try to make this a good general overview of adding your own fields, and for those of you who have requested these specific fields in the past, you should be able to use this code as is.

[edit] Step 1: Add the database fields

ALTER TABLE issue_tracker
ADD COLUMN priority int(2) NOT NULL DEFAULT '2',
ADD COLUMN severity int(2) NOT NULL DEFAULT '3'


[edit] Step 2: Add the set and get functions for the field arrays

In IssueTracker.config.php, add these two declarations somewhere above the setPermissions() function:

protected $_issueSeverity = null;
protected $_issuePriority = null;


Next, add the following function to set up the severity array:

public function setIssueSeverity($severity = array()) 
{
	$severity[1] = array('name' => '1 Critical', 'default' => false);
	$severity[2] = array('name' => '2 Major', 'default' => true);
	$severity[3] = array('name' => '3 Minor', 'default' => false);
	$severity[4] = array('name' => '4 Trivial', 'default' => false);
 
	$this->_issueSeverity = $severity;
}


If the "default" key/value pairs caught your eye, that's good, it means you're paying attention. That's part of Hack #3, so think of this as two hacks for the price of one. ;)

Now the get function:

public function getIssueSeverity() 
{
	if ($this->_issueSeverity === null) {
		$this->setIssueSeverity();
	}
	return $this->_issueSeverity;
}


Here's the same thing for the priority field:

public function setIssuePriority($priority = array()) 
{
	$priority[1] = array('name' => '1 High', 'default' => false);
	$priority[2] = array('name' => '2 Medium', 'default' => true);
	$priority[3] = array('name' => '3 Low', 'default' => false);
 
	$this->_issuePriority = $priority;
}
 
public function getIssuePriority() 
{
	if ($this->_issuePriority === null) {
		$this->setIssuePriority();
	}
	return $this->_issuePriority;
}


[edit] Step 3: Add the new fields to the Model functions

In Models\IssueTrackerModelDefault.php, find the addIssue() function and add the new fields to it:

public function addIssue($postData, $userId, $userName)
{
	$data = array(
		'title'         => $postData['bt_title'], 
		'summary'       => $postData['bt_summary'], 
		'type'          => $postData['bt_type'], 
		'status'        => $postData['bt_status'], 
		'assignee'      => $postData['bt_assignee'],
		'user_id'       => $userId,
		'user_name'     => $userName,
		'project_name'  => $postData['bt_project'],
		'priority_date' => date('Y-m-d H:i:s'),
		'priority'	=> $postData['bt_priority'],		'severity'	=> $postData['bt_severity'],	);
 
	return $this->_dbr->insert($this->_table, $data);
}


Of course, we need to add them to the updateIssue() function as well:

public function updateIssue($issueId, $postData)
{
	$value = array(
		'title'		=> $postData['bt_title'], 
		'summary'	=> $postData['bt_summary'], 
		'type'		=> $postData['bt_type'], 
		'status'	=> $postData['bt_status'], 
		'assignee'	=> $postData['bt_assignee'],
		'priority'	=> $postData['bt_priority'],		'severity'	=> $postData['bt_severity'],	);
 
	if ($postData['bt_status'] == 's_new') {
		$value['priority_date'] = date('Y-m-d H:i:s');
	}
 
	$conds['issue_id'] = (int) $issueId;
 
	return $this->_dbr->update($this->_table, $value, $conds);
}


[edit] Step 4: Add the get functions to the Add and View Actions

Open Actions\IssueTrackerActionAdd.php and Actions\IssueTrackerActionView.php and look for the protected function _setDefaultVars() functions. Add these two lines to both files:

$this->severityArray = $this->_config->getIssueSeverity();
$this->priorityArray = $this->_config->getIssuePriority();


[edit] Step 5: Add the get functions to the List Action

This is only slightly different from step 4. Open Actions\IssueTrackerActionList.php and find the protected function _setDefaultVars() function. Add the following two lines:

$this->issueSeverity  = $this->_config->getIssueSeverity();
$this->issuePriority  = $this->_config->getIssuePriority();


We're almost there. :)

[edit] Step 6: Add the field names to the internationalization file

In IssueTracker.i18n.php, add the following field label definitions:

$messages['en']['severity']        = 'Severity';
$messages['en']['priority']        = 'Priority';


[edit] Step 7: Adding the new fields to the View pages

Let's look at the edit view (edit.html) first, as the table rows you'll be adding are structurally identical to the ones for status and type.

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('priority'); ?>:</strong></td>
	<td><select name="bt_priority" id="bt_priority" tabindex="5" style="width: 150px">
		<?php foreach ($this->priorityArray as $name => $priority): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_priority']) && $_POST['bt_priority'] == $name) ? ' selected="true"' : ''; ?>><?php echo $priority['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>
 
<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('severity'); ?>:</strong></td>
	<td><select name="bt_severity" id="bt_severity" tabindex="6" style="width: 150px">
		<?php foreach ($this->severityArray as $name => $severity): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_severity']) && $_POST['bt_severity'] == $name) ? ' selected="true"' : ''; ?>><?php echo $severity['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>


You'll probably want to adjust the values for tabindex depending on where you insert your fields.

The new table row code for the add view (add.html) is slightly different because it incorporates part of hack #4 for setting default field values.

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('priority'); ?>:</strong></td>
	<td><select name="bt_priority" id="bt_priority" tabindex="5" style="width: 150px">
		<?php foreach ($this->priorityArray as $name => $priority): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_priority']) && $_POST['bt_priority'] == $name) ? ' selected="true"' : ((!isset($_POST['bt_priority']) && $priority['default']) ? ' selected="true"' : ''); ?>><?php echo $priority['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>
 
<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('severity'); ?>:</strong></td>
	<td><select name="bt_severity" id="bt_severity" tabindex="6" style="width: 150px">
		<?php foreach ($this->severityArray as $name => $severity): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_severity']) && $_POST['bt_severity'] == $name) ? ' selected="true"' : ((!isset($_POST['bt_severity']) && $severity['default']) ? ' selected="true"' : ''); ?>><?php echo $severity['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>


Hopefully you're realizing by now that creating any new dropdown fields is pretty much a matter of search and replace in these code snippets.

Adding the new fields to the view View is a piece of cake Cake:

<tr>
	<td width="150" align="left" valign="top" class="fieldBgColor">Priority</td>
	<td><?php echo $this->priorityArray[$this->issue->priority]['name']; ?></td>
</tr>
<tr>
	<td width="150" align="left" valign="top" class="fieldBgColor">Severity</td>
	<td><?php echo $this->severityArray[$this->issue->severity]['name']; ?></td>
</tr>


I didn't add colored backgrounds to these fields because I didn't want my wiki pages to look like a bag of skittles. If you're into that sort of thing, you can add colors by mimicking the code for the status and issue type fields in add.html, view.html and IssueTracker.config.php.

Moving on to list.html, first add the column headers:

<th valign="top" align="left" width="250"><b><?php echo wfMsg('title'); ?></b></th>
<th valign="top" align="left" width="60"><b><?php echo wfMsg('priority'); ?></b></th><th valign="top" align="left" width="60"><b><?php echo wfMsg('severity'); ?></b></th><th valign="top" align="left" width="60"><b><?php echo wfMsg('status'); ?></b></th>


And finally, the value columns. I put mine before the status column:

<td><?php echo $this->issuePriority[$issue->priority]['name']; ?></td><td><?php echo $this->issueSeverity[$issue->severity]['name']; ?></td><td style="background-color: #<?php echo $this->issueStatus[$issue->status]['colour']; ?>"><?php echo $this->issueStatus[$issue->status]['name']; ?></td>


And that's it. Like I said, this should work for any dropdown field you want to add, so knock yourself out.


[edit] Hack #3: Setting default field values in IssueTracker.config.php

All of the necessary code for this hack was included in Hack #2, but here's a quick rundown of the required changes.

[edit] Step 1: Adding the "default" key/value pair

In IssueTracker.config.php, find the dropdown field(s) you want to define default values for and add a new "default" key to each field value array, with a value of "true" or "false". Obviously "true" is used to tell Issue Tracker which value is the default, so only one option should be set to "true".

public function setIssueSeverity($severity = array()) 
{
	$severity[1] = array('name' => '1 Critical', 'default' => false);
	$severity[2] = array('name' => '2 Major', 'default' => true);
	$severity[3] = array('name' => '3 Minor', 'default' => false);
	$severity[4] = array('name' => '4 Trivial', 'default' => false);
 
	$this->_issueSeverity = $severity;
}


[edit] Step 2: Setting up add.html to use the default values

Again, find the field or fields you want to default to a certain value. Change the table row blocks for those fields from:

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('severity'); ?>:</strong></td>
	<td><select name="bt_severity" id="bt_severity" tabindex="6" style="width: 150px">
		<?php foreach ($this->severityArray as $name => $severity): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_severity']) && $_POST['bt_severity'] == $name) ? ' selected="true"' : ''; ?>><?php echo $severity['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>

to:

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('severity'); ?>:</strong></td>
	<td><select name="bt_severity" id="bt_severity" tabindex="6" style="width: 150px">
		<?php foreach ($this->severityArray as $name => $severity): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_severity']) && $_POST['bt_severity'] == $name) ? ' selected="true"' : ((!isset($_POST['bt_severity']) && $severity['default']) ? ' selected="true"' : ''); ?>><?php echo $severity['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>


That's it.


[edit] Hack #4: Setting a field default using a tag argument

So let's say you want to have a dropdown field default to a specific value depending on the project. For example, I added a field called "websystem" so I could associate bugs or tasks with different internal systems like website, admin, intranet, etc. If I have a project page set up for a project that only affects the website, I want the field to default to "website". The hack works by adding the attribute "defaultsystem" to the issues tag with a value matching the name of the websystem which will be the default.

<issues project="Web Redesign" defaultsystem="website" />

Of course, "defaultsystem" could actually be named whatever you want - "defaultcategory", "defaultassignee", etc. This is a good time to mention that attribute names are forced to lowercase, so if you name your attribute "defaultCategory" and try to reference it that way in the code, it won't work. Conversely, the value of the attribute should match your field array value exactly. So if the value is "Website" then your attribute would need to be defaultsystem="Website".

On to the code.


[edit] Step 1: Add a default for your default

In Actions\IssueTrackerActionAdd.php, you'll need to add a line to the _setDefaultVars() function that looks like this:

$this->defaultsystem = '';


Simple so far. A few lines down, in the _setHookPreferences() function, add this block:

if (array_key_exists('defaultsystem', $this->_args) && $this->_args['defaultsystem'] !== '') {
	$this->defaultsystem = $this->_args['defaultsystem'];
}

[edit] Step 2: Setting up add.html to use the default

The code for this is just slightly different from the code used in Hack #3.

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('system'); ?>:</strong></td>
	<td><select name="bt_websystem" id="bt_websystem" tabindex="4" style="width: 150px">
		<?php foreach ($this->systemArray as $name => $websystem): ?>  
			<option value="<?php echo $name; ?>"<?php echo (isset($_POST['bt_websystem']) && $_POST['bt_websystem'] == $name) ? ' selected="true"' : ((!isset($_POST['bt_websystem']) && $this->defaultsystem == $websystem['name']) ? ' selected="true"' : ''); ?>><?php echo $websystem['name']; ?></option>
		<?php endforeach; ?>
	</select></td>
</tr>


[edit] Hack #5: Changing the default list sort order

I want my issue list sorted by priority, severity and issue id, in that order. Having the most important issues at the top make it easier to see what you should be working on first. Including issue id in the ordering criteria ensures that older issues get attention before newer ones having the same priority and severity.

This one's actually fairly simple. In Models\IssueTrackerModelDefault.php, find the getIssues() function somewhere around line 30 and change your "Order By" option from this:

'ORDER BY' => 'priority_date DESC, issue_id ASC'

to:

'ORDER BY' => 'priority ASC, severity ASC, issue_id ASC'

... or whatever else you want to order by.


[edit] Hack #6: Replacing the summary field with an HTML editor

I got tired of either dealing with one huge summary paragraph or hand-coding HTML into that little textarea pretty quick. Adding a WYSIWYG editor is actually really easy, and you'll kick yourself for not having done it before. We're going to be using the Yahoo YUI SimpleEditor because it covers all the bases and is easy to implement.


[edit] Step 1:Replace the stylesheets and JavaScript in add.html and edit.html

You're going to be making the exact same changes to both files, so I'm just going to show the changes once.

At the very top of the file (pick one), you're going to replace this code:

<link rel="stylesheet" type="text/css" href="/skins/common/editor/html/html-skin.css"/>
<script>
$(document).ready(function()	{	
	$("#html").jTagEditor({		
		tagSet:"/skins/common/editor/html/html-tags.js",
		tagMask:"",
		insertOnShiftEnter:"\n\n",
		insertOnCtrlEnter:"" 
	});
});
</script>

with this:

<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/editor/assets/skins/sam/simpleeditor.css">
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js&2.8.0r4/build/container/container_core-min.js&2.8.0r4/build/element/element-min.js&2.8.0r4/build/editor/simpleeditor-min.js"></script>
<script>
	var myEditor = new YAHOO.widget.SimpleEditor('bt_summary', {
		height: '300px', //150
		width: '600px', //415
		handleSubmit: true,
		insert: true,
		filterWord: true,
		dompath: false //Turns on the bar at the bottom
	});
	myEditor.render();
</script>


[edit] Step 2: Apply the yui-skin-sam class name to a parent element

Add the YUI class to the parent tag for the field table rows:

<input type="hidden" name="title" value="<?php echo $this->pageKey; ?>" />
  <table width="530" border="0" class="yui-skin-sam">    <tr>


[edit] Step 3: Make a minor adjustment to the textarea tag

This change gets rid of the jTagEditor class (for the code you just ripped out) and renames the field id so Yahoo can take over your computer and turn you into a zombie geek as you spend the next 3 hours transfixed by the coolness of copying images and text from web pages and pasting them right into your new summary field. Just be sure to do all this stuff to that other file so disappointment doesn't hit you in the chest like a sledgehammer when you find yourself staring at that pitiful little textarea again.

Change this:

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('summary'); ?>:</strong></td>
	<td><textarea rows="10" cols="10" tabindex="2" id="html" class="jTagEditor" accesskey="," name="bt_summary"><?php echo (isset($_POST['bt_summary'])) ? $_POST['bt_summary'] : ''; ?></textarea></td>
</tr>

to this:

<tr>
	<td align="left" valign="top"><strong><?php echo wfMsg('summary'); ?>:</strong></td>
	<td><textarea rows="10" cols="10" tabindex="2" id="bt_summary" accesskey="," name="bt_summary"><?php echo (isset($_POST['bt_summary'])) ? $_POST['bt_summary'] : ''; ?></textarea></td>
</tr>


... and don't say I didn't warn you.

That's all I have time for now. Enjoy, and thanks to Federico for building such a great extension.

--Clif 10:29, 13 November 2009 (UTC)


[edit] Questions and Comments on IssueTracker 1.0

[edit] 25 June 2009 Task End Date and Outcome fields ??

HI great extension Would it be useful to others to add the ability to record the actual end date of the task and its outcome ie successful, incomplete, partial etc

Cheers

Mark W

[edit] April 21, 2009 Where do I configure the Issue list to show all issues instead of 30 items by default in View Issue?

Solution:

Models/IssueTrackerModelDefault.php
// public function getIssues($conds, $offset, $limit = 30)

--BertvanderHooft 20:34, 24 October 2009 (UTC)

[edit] April 9, 2009: Is there any way to display all the issues and the details entered for those issues?

[edit] February 22, 2009: small patch to have text parsed by mediawiki

Hi, we made some minor changes to the code to have the issues parsed by mediawiki. It is available at http://hackerspace.lu/issuetracker_mediawiki.patch

Other things that we'd love to see: (besides email notification)

  1. Present title in italic if task is in progress, make it bold if it is marked as ASAP, etc..
  2. Extend title varchar size
  3. When someone is set as assignee, change status to assigned automatically
  4. Natural sort order!

thanks, hackerspace.lu
Dead Link for the patch. Where can I find it?

Do you have a robust solution for this because it doesn't work with Mediawiki 1.14 and FCKeditor? The internalParse function fails. I've tried using global $wgParser but it doesn't help. I've solved it temporarily by making the title an implicit anchor but it's not what I wanted. - John Colman

[edit] 29 August 2008: IssueTracker vs Issue_Tracker

Produkt Version MediaWiki 1.13.0 PHP 5.1.2 (isapi) MySQL 5.0.51a-community-nt-log Windows 2003

On my System the IssueTracker Appears on the specialPage wiki/index.php?title=Spezial:Issue_Tracker (note .. with underline)

but if i klick on add the wiki/index.php?title=Spezial:Issue_Tracker the underline is removed

wiki/index.php?title=Spezial:IssueTracker&bt_action=add

...

I searched in the files .. i only found a IssueTracker but no Issue_Tracker!

I had the same issue when installing on Windows (though it worked fine on Ubuntu when I tried.
I fixed it by editing the 'IssueTracker.i18n.php' file replacing line
$messages['en']['issuetracker']    = 'Issue Tracker';
with
$messages['en']['issuetracker']    = 'IssueTracker';
204.99.250.45 21:55, 20 March 2009 (UTC)


[edit] ???

I've followed the installation instructions and when I add <issues /> to a page I get a very long string that starts with: "@ENCODED@PHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCmRpdiNpc3N1ZUZpb"

When will version 1.1 be available. I would like to have the email feature.

This is with MediaWiki 1.11.0 and PHP 5.2.5

This issue should be fixed with r63, another problem occurs if you use a version containing only one '.' like 1.13alpha. The author didn't fix that yet, but I sent him a proposal. --Osai 13:14, 11 March 2008 (UTC)
  • 11 March 2008: Encoding Issue

Hi, yes, I'm aware of this (thanks Osai) and I'm trying to implement a solution for the latest versions of MediaWiki. To fix this manually, you can update the IssueTrackerAction.php file.

File: IssueTracker/Actions/IssueTrackerAction.php
Line: 269

Change: return $this->_processOutputEncoding($output); To: return $output;

  • 11 March 2008: Encoding Issue Resolved

I've added the ParserAfterTidy hook to fix the encoding issue in MediaWiki > 1.11.2. The ParserAfterTidy hook is available from version 1.5.0.

Nice job. And it is working very well, here is a live demo, I'll probably have a closer look at the styling, maybe you could add a super class 'IssueTracker' to apply custom styles using CSS. Best Regards, Osai 23:37, 11 March 2008 (UTC)


  • 19 November 2008: Unable to add new issue

I've followed the installation instructions perfectly. However, when I click on the "add" link to insert a new issue all I get is a blank white page. I do not receive any error messages either. Is there a known fix for this? Thanks, Dave Dchou 04:12, 20 November 2008 (UTC)


[edit] Feature Request

[edit] Comments

Great extension, I love it! Keep up the good work on it!

I would like to make a request/suggestion for a "Comments" capability on each issue. I would try to modify it myself to manage that but I'm not quite proficient enough with the code. Could this be done?

--Kethra 05:34, 28 March 2008 (UTC)

[edit] View Archived issues

Would be Nice if it is possible so see old/done issues.

[edit] Granular permissions by project

I'd like to see the IssueTracker have the capability to set permissions by project. In our case, different developer teams are responsible for different projects, and I'd like to have the ability to assign, resolve and close projects reside within the team responsible for the project. --Lhridley 13:36, 18 June 2009 (UTC)

[edit] Support for Wikitext markup

Wow! wouldnt' it be great if the text box would handle content in wikitext markup? --Lhridley 13:37, 18 June 2009 (UTC)

[edit] Wiki markup support -- future enhancement?

I think that the Summary filed should allow wiki formatting. --DCLXVI 19:26, 8 April 2008 (UTC)

I agree...Wiki markup would be super! --Lhridley 13:10, 18 June 2009 (UTC)

[edit] Some advices for this great extension

[edit] i18n for Taiwanese Chinese

$messages['zh-tw']['issuetracker']    = '討論議題追蹤';
$messages['zh-tw']['view_issues']     = '查看討論議題';
$messages['zh-tw']['project']         = '計劃';
$messages['zh-tw']['add']             = '新增';
$messages['zh-tw']['cancel']          = '取消';
$messages['zh-tw']['edit']            = '編輯';
$messages['zh-tw']['delete']          = '刪除';
$messages['zh-tw']['archive']         = '歸檔';
$messages['zh-tw']['view']            = '查看';
$messages['zh-tw']['id']              = '序號';
$messages['zh-tw']['search']          = '搜尋';
$messages['zh-tw']['filter_by']       = '篩選條件';
$messages['zh-tw']['filter_title']    = '篩選器';
$messages['zh-tw']['type']            = '型態';
$messages['zh-tw']['title']           = '標題';
$messages['zh-tw']['summary']         = '摘要';
$messages['zh-tw']['status']          = '狀態';
$messages['zh-tw']['reporter']        = '提報者';
$messages['zh-tw']['assignee']        = '指派';
$messages['zh-tw']['unassigned']      = '未指派的';
$messages['zh-tw']['date']            = '日期';
$messages['zh-tw']['action']          = '行動';
$messages['zh-tw']['back']            = '返回';
$messages['zh-tw']['form_submit']     = '送出';
$messages['zh-tw']['form_apply']      = '應用';
$messages['zh-tw']['login_msg']       = '須登入才能新增議題。';
$messages['zh-tw']['invalid_action']  = '無效的行動名稱';
$messages['zh-tw']['error_bt_title']  = '請輸入標題';
$messages['zh-tw']['not_authorized']  = '您未有足夠的權限以查看此頁的內容';
$messages['zh-tw']['invalid_id']      = '無效的議題序號';

[edit] Some asking

IssueTracker asking 1.png
IssueTracker asking 4.png
IssueTracker asking 5.png

[edit] Some thing about "archived

  • It's seem to having some situations.
    • Once a issues be archived, it's can't be search.
    • How to change a archived issues to other status.
  • Yeah.. I agree! This IssueTracker would be far more useful if you could "unarchive" issues!
  • One more agree :D

[edit] Add Mail function

It will be better if this extension can send email to a user when a issues assigned to him or something changed in the issues like Todo Tasks.:-) --Roc michael 17:10, 15 April 2008 (UTC)

This can be achieved pretty easy, do the following modifications: open Actions/IssueTrackerActionAdd.php and edit funcion addAction(), paste the following code:

   if ($_POST['bt_assignee'] != wfMsg('unassigned')) {
       $assignee = User::newFromName($_POST['bt_assignee']);
       $assignee->sendMail(wfMsg('issue_added').": ".$_POST['bt_title'],wfMsg('filehist-user')." ".$userName." ".wfMsg('has_assigned_issue').": ". $_POST['bt_title']. "\n".wfMsg('status').": " .$this->statusArray[$_POST['bt_status']]['name']. "\n".wfMsg('type').": " .$this->typeArray[$_POST['bt_type']]['name']."\n".wfMsg('summary').": ".$_POST['bt_summary']."\n\n".wfMsg('see')." http://".$_SERVER['HTTP_HOST'].$this->listUrl);
   }

after the line

   $this->getModel('default')->addIssue($_POST, $userId, $userName);

Similarly, open Actions/IssueTrackerActionEdit.php and edit function editAction(), paste the following code:

   if ($_POST['bt_assignee'] != wfMsg('unassigned')) {
       $assignee = User::newFromName($_POST['bt_assignee']);
       $assignee->sendMail(wfMsg('issue_changed').": ".$_POST['bt_title'],wfMsg('filehist-user')." ".$userName." ".wfMsg('has_changed_issue').": ". $_POST['bt_title']. "\n".wfMsg('status').": " .$this->statusArray[$_POST['bt_status']]['name']. "\n".wfMsg('type').": " .$this->typeArray[$_POST['bt_type']]['name']."\n".wfMsg('summary').": ".$_POST['bt_summary']."\n\n".wfMsg('see')." http://".$_SERVER['HTTP_HOST'].$this->listUrl);
   }

after the line

   $result = $this->getModel('default')->updateIssue($this->issueId, $_POST)

Finally, add the following messages into IssueTracker.i18n.php:

   $messages['en']['issue_added']      = 'New issue added';
   $messages['en']['has_assigned_issue']   = 'has assigned new issue to you';
   $messages['en']['issue_changed']        = 'Issue changed';
   $messages['en']['has_changed_issue']    = 'has changed an issue assigned to you';
   $messages['en']['see']  = 'See';

And that is, now you'll get an email once a new issue is assigned to you or changed. Milos Jakubicek 15:01, 4 August 2009 (UTC)

[edit] Add Priority

The one item missing from making this a very useful tool is the ability to set a priority. The default would be blank, but then the list should be at the very least 1 through 10. If I can I'll try to make the modifications myself to see if I can make it work and submit it for review. --cvtrig 02:24, 19 April 2008 (PST)

Has this been added?

[edit] Special Page fix

Thanks for the great extension. I particularly like how your MVC framework lets you run everything on a Special Page instead of at the issue tag.

However I needed to make a few tweaks to get it to work with multiple projects ...

Index: IssueTracker.body.php
===================================================================
--- IssueTracker.body.php	(revision 17)
+++ IssueTracker.body.php	(working copy)
@@ -56,10 +56,16 @@
 		// Set the page namespace
 		$title = Title::makeTitle(NS_SPECIAL, $this->getName());
 		$namespace['dbKey'] = $title->getPrefixedDbKey();
+		if ($par) $namespace['dbKey'] .= '/' . $par;
 		$namespace['text'] = $title->getPrefixedDbKey();
 		
+		$args = array();
+		$args['project'] = $par;
+
+		$isParserHook = false;
+		
 		// Process request
-		$output = $this->_processActionRequest($namespace);
+		$output = $this->_processActionRequest($namespace, $isParserHook, $args);
 		
 		// Output
 		$this->setHeaders();
Index: IssueTracker.i18n.php
===================================================================
--- IssueTracker.i18n.php	(revision 17)
+++ IssueTracker.i18n.php	(working copy)
@@ -10,7 +10,7 @@
  * @copyright   Copyright (c) 2008 Federico Cargnelutti
  * @license     GNU General Public Licence 2.0 or later
  */
-$messages['en']['issuetracker']    = 'Issue Tracker';
+$messages['en']['issuetracker']    = 'IssueTracker';
 $messages['en']['view_issues']     = 'View Issues';
 $messages['en']['project']         = 'Project';
 $messages['en']['add']             = 'add';
@@ -40,4 +40,4 @@
 $messages['en']['error_bt_title']  = 'Please enter a title';
 $messages['en']['not_authorized']  = 'You are not authorized to view this page';
 $messages['en']['invalid_id']      = 'Invalid issue ID';
-?>
\ No newline at end of file
+?>

With these changes you can use Special:IssueTracker/<project>. There is still an issue with the i18n bits; it doesn't seem to work when the name of the special page is different from 'IssueTracker' - hence the change in the i18n file.

Eclecticdave 19:29, 30 May 2008 (UTC)

[edit] Just installed it

On Ubuntu 8.04, and it looks great!

I recommend it to be built into Wikipedia by default. 76.28.255.165 08:26, 15 July 2008 (UTC)

[edit] Bug with multiple issue trackers on a page

I have created several pages with multiple issue trackers. It is sort of a meta tracking page. It works great, but when you add a new issue, it creates an issue every issue tracker on the page, with the exact same content, into the one issue tracker.

Supporting more than one issue tracker on a page should be a supported scenario.

[edit] Installation problem

I try to install the IssueTracker extensions, after I add the "require_once $IP . '/extensions/IssueTracker/IssueTracker.php';" line to my LocalSettings.php file, I get a blank white page as my main wiki page.

I get log entries like so:

Warning: require_once(/www/Interactive/extensions/IssueTracker/Models/IssueTrackerModelDefault.php) [function.require-once]: failed to open stream: No such file or directory in /www/Interactive/extensions/IssueTracker/IssueTracker.body.php on line 3

Fatal error: require_once() [function.require]: Failed opening required '/www/Interactive/extensions/IssueTracker/Models/IssueTrackerModelDefault.php' (include_path='/www/Interactive:/www/Interactive/includes:/www/Interactive/languages:.:/usr/local/lib/php') in /www/Interactive/extensions/IssueTracker/IssueTracker.body.php on line 3

Any suggestions?

[edit] Major Bug/Glitch

I was unable to add a new issue or search for issues, it seems theres a glitch or something going on here. . the bug is already mentioned here on this talk page. Issue_Tracker vs IssueTracker

I tried to find the line in the code myself with no luck.

To fix this, edit IssueTracker.i18n.php, and change
$messages['en']['issuetracker']    = 'Issue Tracker';

to

$messages['en']['issuetracker']    = 'IssueTracker';

--Lhridley 12:48, 18 June 2009 (UTC)


In the current trunk version of the Special page for Issue Tracker has a glitch that causes the php includes to point to an "invalid special page".

While trying to use this from a <issue /> tag in an article causes


PHP Error Message

Warning: IssueTrackerActionAdd::require_once(SpecialListusers.php) [issuetrackeractionadd.require-once]: failed to open stream: No such file or directory in /home/$user/public_html/wiki/extensions/IssueTracker/Actions/IssueTrackerActionAdd.php on line 119

PHP Error Message

Fatal error: IssueTrackerActionAdd::require_once() [function.require]: Failed opening required 'SpecialListusers.php' (include_path='/home/$user/public_html/wiki:/home/$user/public_html/wiki/includes:/home/$user/public_html/wiki/languages:.:/usr/lib/php:/usr/local/lib/php') in /home/$user/public_html/wiki/extensions/IssueTracker/Actions/IssueTrackerActionAdd.php on line 119


This can be fixed by changing the line 119 to require_once $IP.'includes/specials/SpecialListusers.php'; where $IP is path to the wiki folder. --Tejasparikh 22:44, 21 March 2009 (UTC)

[edit] Attachements how to?

1. How can I add attachments in the edit window?,

2. If somebody post issues and then if the solver want to guide then how to do? May the solver need to edit the window and reply? Its mean issue submitter always need to check issues. is it possible to make the highlights if there is new messages in the issue then issue submitter easily know there is new message in the issue.

[edit] Version 1.1

Is version 1.1 available for download. I would like to have email and attachment capabilities. Thanks

[edit] Ver 1.1

How can I download version 1.1??? Please help me...

  • Yep, me too. I contacted the author, let's see if he answers. --Michaelaye 17:32, 4 November 2008 (UTC)

[edit] some stuff

currently working on some improvements, wiki markup is fine for summ and header

own page for issue etc. , just to note here.

nice tool! 84.57.29.233 08:23, 14 November 2008 (UTC)

[edit] Install error

Hi. I've just checked out the repository (at phpimpact.com) and followed the instructions in the section Installation. I restarted Apache, and create a new, empty page, with "<issues />". When saving, I get this error:

"Fatal error: Call to undefined function wfLoadExtensionMessages() in /var/lib/mediawiki1.10/extensions/IssueTracker/IssueTracker.body.php on line 39".

Any idea? Thanks, --Florent (2008-11-22T01:45:00+02:00)

-> UPDATE WIKI VERSION? i had the same error until upgrade wiki upto current version (1.13.3). It could be because of some functions or objects (for example $wgExtensionMessagesFiles) is introduced in later versions then you have ...
I think extension-info-label for IssueTracker needs to be updated too; it says that minimal version needed is "1.9.0 or greater" but here we see that it needs at least "1.11.0" (for $wgExtensionMessagesFiles). <_<

[edit] Semantic Mediawiki integration?

Hi first of all very excellent extension, I was wondering if this can be integrated to SMW?

[edit] Assignee List

The drop down Assignee box does not show more than 51 users

[edit] Use different Config files for seperate Issue Tracker pages

Great extension! I'd like to be able to customize the issue types and status specific to each issue tracker that I run. Right now it gets a little confusing since I have added issue types that only pertain to one of my issue tracker pages, but those issue types are also showing up on every issue status page in my wiki.

[edit] Problem when trying to use groups to restrict permissions

Hello, first of all thanks for an excellent extension, it seems to fulfill our needs perfectly. Just having a small issue while attempting to restrict the ability of certain users to add, assign, archive etc. Ive attempted to create a separate group that will have permissions to do these things but will allow only normal logged in users to view. I dont want to use the Sysop user as per the example I have done the following as per examples create a new group in my localsettings.php file (not sure what permissions they will need to be able to create and assign tasks)

#Create the WAB group
$wgGroupPermissions['WAB' ]['edit'] = true;
$wgGroupPermissions['WAB' ]['read'] = true;
$wgGroupPermissions['WAB' ]['createpage'] = true;

and in my issuetracker.config.php

  public function setPermissions()
        {
                $perms['list']     = array('group' => '*');
                $perms['view']     = array('group' => '*');
                $perms['add']      = array('group' => 'WAB');
                $perms['edit']     = array('group' => '*');
                $perms['archive']  = array('group' => '*');
                $perms['delete']   = array('group' => '*');
                $perms['assign']   = array('group' => 'WAB');
                $perms['assignee'] = array('group' => '*');

                $this->_permissions = $perms;

I am a member of the WAB group from the user list page

Wiltonm ‎(WAB, Bureaucrat, Sysop)

But when attempting to add or assign i get the following error You are not authorized to view this page

are there specific permissions that i need to assign the WAB group to allow, assigning and adding ???

cheers regards Mark Wilton

203.9.185.216Resolved, Case is significant, make your group all lower case Mark Wilton

[edit] Another solution

Or, if you'd prefer not to have the extension dictate your group names, go to the hasPermission function in IssueTrackerAction.php and change

if ($group == strtolower($perms[$action]['group'])) {

to

if ($group == $perms[$action]['group']) {

Thanks, Clif Johnston

[edit] Message error (MW 15)

Is any body else receiving this error:

Warning: require(IssueTracker/IssueTracker.i18n.php) [function.require]: failed to open stream: 
No such file or directory in /home/content/x/x/x/xxxxxx/html/includes/MessageCache.php on line 808
 
Fatal error: require() [function.require]: Failed opening required 'IssueTracker/IssueTracker.i18n.php'
(include_path='/home/content/x/x/x/xxxxxx/html:/home/content/x/x/x/xxxxxxx/html/includes:/home/content/x/x/x/xxxxxxxx/html/languages
:.:/usr/local/php5/lib/php') in /home/content/x/x/x/xxxxxx/html/includes/MessageCache.php on line 808

Does anybody have any ideas?--05:13, 11 July 2009 (UTC)


[edit] Special List Users Error

After seeing mention of this error in widely varying spots i collected them all together. **29 sept 2009**

  • 20 November 2008: Unable to add new issue - UPDATE

I figured out that within IssueTrackerActionAdd.php it references the SpecialListusers.php file, which can't be found. Is the SpecialListusers.php file supposed to be included in the Issue Tracker download? Thanks, Dave Dchou 23:51, 20 November 2008 (UTC)

  • November 21, 2008 - ME TOO

I had the same problem mentioned in

20 November 2008: Unable to add new issue - UPDATE
I figured out that within IssueTrackerActionAdd.php it references the SpecialListusers.php file, which can't be  
found. Is the SpecialListusers.php file supposed to be included in the Issue Tracker download? Thanks, Dave Dchou  
23:51, 20 November 2008 (UTC)

I found that SpecialListusers.php is in wiki/include/specials. The path used in IssueTrackerActionAdd.php doesn't get there. you can copy SpecialListusers.php to the extensions/IssueTracker/Actions folder, or fix the pathing in IssueTrackerActionAdd.php, line 119 from


/** @see SpecialListusers **/
require_once 'SpecialListusers.php'; 

to something like

/** @see SpecialListusers **/
require_once '/includes/specials/SpecialListusers.php'; /*Fix Line, this doesn't work*/

/* remove the leading / (before includes) so the path wil be right*/

I'm a PHP newbie, so still figuring out how to make the path correct, but copying the special page into the actions folder is functional workaround. Someone tell me if you can recomend the correct PHP for the line above? --Janunson 13:31, 21 November 2008 (UTC)

  • January 06 2009

Just found one possible Solution.. But be aware, I am also a PHP noob :-) (at least it works for me)

/** @see SpecialListusers **/
require_once dirname(__FILE__) . '/../../../includes/specials/' . 'SpecialListusers' . '.php';


There is also this error in MW 15

Warning: require_once(SpecialListusers.php) [function.require-once]: 
failed to open stream: No such file or directory in 
xxxxx/xxxxx/xxxx/extensions/IssueTracker/Actions/IssueTrackerActionAdd.php on line 119


Which points to this line:

require_once 'SpecialListusers.php';

The file is simply not there. I am missing something? --iWiki 22:51, 24 July 2009 (UTC)


I'm not running 15 so can't check but I assume it's likely the same issue as shown further up the page. Try the solution offered there

[edit] Alternative SQL code for Postgres

I modified the table creation code to work on Postgres:

CREATE TABLE mediawiki.issue_tracker (
 issue_id serial NOT NULL,
 type varchar(5) NOT NULL default 't_bug',
 title varchar(100) NOT NULL,
 summary text NOT NULL,
 status varchar(5) NOT NULL default 's_new',
 assignee varchar(40) NOT NULL,
 user_name varchar(40) NOT NULL,
 user_id int NOT NULL,
 project_name varchar(100) NOT NULL,
 deleted int NOT NULL default '0',
 history text,
 priority_date timestamp NOT NULL default '1970-01-01 00:00:00',
 date_created timestamp NOT NULL default CURRENT_TIMESTAMP,
 PRIMARY KEY (issue_id)
);

Note that I removed the NOT NULL constraint from the history column, since it is currently not used by the code, and as such it would lead to fatal exceptions. Also, there is no index on the user_id column, but that could be created separately. For the time being, I just went for the absolute minimum to make it work. - Patai Gergely

[edit] Release of version 1.1

What is the expected realease date of version 1.1?

--Dgennaro 20:22, 13 November 2009 (UTC)

[edit] A Hack Similar to Clif's to add a text field instead of a radio field

I will format this appropriately at a later time, But here is is for now. Creating a new text field This tutorial will create a text entry field called phone number

This is similar to Clif's but instead of adding a drop down menu, you add a text box

I'll call it Chuck's Hack

[edit] Create the database entry:

ALTER TABLE issue_tracker ADD COLUMN phone_number text NOT NULL

[edit] Edit the files to have the capacity to store the extra field

a)Open issueTracker.i18n.php and add this line

$messages['en']['field name']      = 'how you want it displayed';
ie.
$messages['en'][‘phone_number']      = 'Telephone Number';

b)Open IssueTrackerActionEdit.php and around line 47, add to list:

'bt_phone_number'  => $row->phone_number,<- don’t forget the comma at the end

There is a list of similarly formatted lines there already, and where in there you put it doesn’t matter

c) In issueTrackerModelDefault.php Add to public function addIssue($postData, $userId, $userName)

‘phone_number' => $postData['bt_phone_number'],<- don’t forget the comma at the end

Do the same in the next function which is update issue

Once again, in both functions, the order does not matter

d)In edit.html add this after the summary section, around line 29, or read the html and add it wherever you want to. You are pretty much adding a column to the row. The cols variable should be 10 but play around with the rows and tabindex to see what they do. The phone_number variable is used 4 time so make sure you replace all 4.

    <tr>
      <td align="left" valign="top"><strong><?php echo wfMsg(‘phone_number); ?>:</strong></td>
      <td><textarea rows="1" cols="10" tabindex="1" id="html" class="jTagEditor" accesskey="," name="bt_phone_number"><?php echo (isset($_POST['bt_phone_number’])) ? $_POST['bt_phone_number'] : ''; ?></textarea></td>
    </tr>

Add this in the same way to add.html e)In view.html add:

  <tr>
    <td width="150" align="left" valign="top" class="fieldBgColor">Phone Number</td>
    <td><?php echo $this->issue->phone_number; ?></td>
  </tr>

[edit] If you want it shown in the list format view

   -> when it is displayed on the web page and not just when viewing/editing the details

a)do the following in list.html

i)Around line 75 add the line below, replacing ** with the width that you want.

 <align="top" align="left" width="**"><b><?php echo wfMsg(‘phone_number’); ?></b></th>


Remember the relative position because for the next step, since you are inserting another column in the table, you want to place it in the same column in the second row which you add below.

ii)Around line 91 add the following:

<td><span class="<?php echo $issue->status; ?>"><?php echo htmlspecialchars($issue->phone_number); ?></a></span></td>

In the same relative position to where you added the first. I.e. if you add the first right before assignee, you add this one before the assignee column.

And there you go, you have another column added.

[edit] More than one issue tracker IN THE WIKI is not properly supported

It looks fine, but when you create a new issue, it is not listed as the first issue for that page. Instead it is incremented from the highest number of the last edited IssueTracker.

[edit] Not possible to add more than 93 issues

I already changed the limit at "public function getIssues($conds, $offset, $limit = 300)" in Models/IssueTrackerModelDefault.php, but I simply can not add more than 93 Issues. If I create the 94th issue, the wiki page will only display it's title (no issue list, no other wiki text). After I delete the 94th issue in the databank, everything is fine again.

Anybody met the same problem? ideas? Thanks! --- Febr. 2010