Extension talk:IssueTracker

From MediaWiki.org
Jump to: navigation, search
  • Clif's hacks moved to subpage /Clif's hacks.
  • Most of the rest moved to subpage /Archive for the time being. Please resurrect all issues from there which are still valid. TIA --Nakohdo 19:26, 2 February 2011 (UTC)

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


// public function getIssues($conds, $offset, $limit = 30)

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

i18n for Taiwanese Chinese[edit]

$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']      = '無效的議題序號';

Some asking[edit]

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

Some things about "archived"[edit]

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?
I agree! This IssueTracker would be far more useful if you could "unarchive" issues!

Add Mail function[edit]

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)

Special Page fix[edit]

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
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)

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

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, Case is significant, make your group all lower case Mark Wilton

Another solution[edit]

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'])) {


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

Thanks, Clif Johnston

Special List Users Error[edit]

I found that SpecialListusers.php is in wiki/include/specials. The path used in IssueTrackerActionAdd.php doesn't get there.

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

Try changing that line to

require_once $IP . 'includes/specials/SpecialListusers.php';

--Nakohdo 20:05, 31 January 2011 (UTC)

Alternative SQL code for Postgres[edit]

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

A hack similar to Clif's to add a text field instead of a radio field[edit]

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

Create the database entry:[edit]

ALTER TABLE issue_tracker ADD COLUMN phone_number text NOT NULL

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

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

$messages['en']['field name']      = 'how you want it displayed';
$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.

      <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>

Add this in the same way to add.html

e) In view.html add:

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

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

   -> 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.

Having problem in adding issues. Please help[edit]

Hi, I have installed issue tracker for my mediawiki intranet. It works fine but have problem with adding new issues to tracker. When I login as Admin and double click 'View Issues' using right button in the mouse, the add issue page opens well. But, this does not happen when I am logged in as a normal user. It doesn't work even after I tried changing permissions in IssueTracker.config.php from

$perms['list']     = array('group' => '*');
$perms['view']     = array('group' => '*');
$perms['add']      = array('group' => '*');
$perms['edit']     = array('group' => '*');
$perms['archive']  = array('group' => '*');
$perms['delete']   = array('group' => '*');
$perms['assign']   = array('group' => 'sysop');
$perms['assignee'] = array('group' => 'devel');


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

I am quite new to wiki. If someone know how to fix this, please help me

Thank you, Sathish

"[add]" link not displayed if section-editing disabled[edit]

The "[add]" link is with a span tag with a class of "editsection". If section editing is disabled, though, the "[add]" link does not display.

I ended up editing all pages in the Views/ directory to add style="display: block" to each span tag with a class of "editsection", since I really don't want section editing enabled.

CSchelin 20:01, 28 October 2010 (UTC)

i18n - German[edit]

Only a quick translation, just add this code to IssueTracker.i18n.php

/** German (Deutsch)
* @author Kghbln
* @author Nakohdo
$messages['de'] = array(
        'issuetracker'    => 'Issue Tracker',
        'view_issues'     => 'Aufgaben anzeigen',
        'project'         => 'Projekt',
        'add'             => 'hinzufügen',
        'cancel'          => 'abbrechen',
        'edit'            => 'bearbeiten',
        'delete'          => 'löschen',
        'archive'         => 'archivieren',
        'view'            => 'anzeigen',
        'id'              => 'ID',
        'search'          => 'Suchen',
        'filter_by'       => 'Filtern nach',
        'filter_title'    => 'Filtern',
        'type'            => 'Typ',
        'title'           => 'Titel',
        'summary'         => 'Zusammenfassung',
        'status'          => 'Status',
        'reporter'        => 'Berichtender',
        'assignee'        => 'zugewiesen an',
        'unassigned'      => 'nicht zugewiesen',
        'date'            => 'Datum',
        'action'          => 'Aktion',
        'back'            => 'zurück',
        'form_submit'     => 'Speichern',
        'form_apply'      => 'Anwenden',
        'login_msg'       => 'Du musst dich anmelden, um Aufgaben hinzufügen zu können.',
        'invalid_action'  => 'Ungültiger Name für Aktion',
        'error_bt_title'  => 'Bitte gib einen Titel ein',
        'not_authorized'  => 'Du hast keine Berechtigung, dir diese Seite anzeigen zu lassen.',
        'invalid_id'      => 'Ungültige Aufgaben-ID',

/** German (formal address) (‪Deutsch (Sie-Form)‬)
* @author Nakohdo
$messages['de-formal'] = array(
        'login_msg'       => 'Sie müssen sich anmelden, um Aufgaben hinzufügen zu können.',
        'error_bt_title'  => 'Bitte geben Sie einen Titel ein',
        'not_authorized'  => 'Sie haben keine Berechtigung, diese Seite anzeigen zu lassen.',

--Nakohdo 15:45, 1 February 2011 (UTC)

Hi Nakohdo, I reformated the translations to match MediaWiki standard. I am not sure if this extension supports language fallback. If not 'de-formal' should be fully translated. Perhaps you test it at your wiki if my changes work. Otherwise just revert my edit. Cheers --[[kgh]] 16:14, 1 February 2011 (UTC)
Many thanks for reformatting! That was next on my to-do-list ;-) It's much easier to maintain and reuse for additional languages. I'm also working on making the rest of the extension's messages translatable - so stay tuned. --Nakohdo 10:36, 2 February 2011 (UTC)
 :) Another option would be to move this extension into MediaWiki-SVN. Thus I18N would automatically performed by users of translatewiki.net in heaps of languages. Cheers --[[kgh]] 11:12, 2 February 2011 (UTC)
That would be great. Do you have any pointers on how to do this? tia --Nakohdo 13:56, 2 February 2011 (UTC)
That is what I have found: Commit_access Cheers --[[kgh]] 14:12, 2 February 2011 (UTC)
Thanks! --Nakohdo 18:02, 2 February 2011 (UTC)

Add <nowiki> tags to avoid breaking Special:Version page[edit]

Change IssueTracker.php as follows to avoid that there will show an issue tracker on the Special:Version page.

And while you're at it, also add the correct URL to the extension's homepage and a link to it's own special page (only relevant lines shown):

$wgExtensionCredits['parserhook'][]  = array(
  'url'           => 'http://www.mediawiki.org/wiki/Extension:IssueTracker',
  'description'   => 'Adds <nowiki><issues /></nowiki> parser function for viewing and adding issues',
$wgExtensionCredits['specialpage'][] = array(
  'url'           => 'http://www.mediawiki.org/wiki/Extension:IssueTracker',
  'description'   => 'Adds a [[Special:Issue Tracker|special page]] for managing issues',


--Nakohdo 19:31, 8 February 2011 (UTC)

adding/editing issues only works in the "talk" namespace for me[edit]

I'm running MW-1.16.1 and have just added this extension. I did a number of the fixes that are listed and everything works and makes sense except that the adding and editing of issues only works in the "Talk:" namespace. I am logged in as the WikiSysop. Is this the intended behavior?

Unable to load mediawiki[edit]

I am not sure that this matters but I'm using Fedora 14 and the latest mediawiki. When adding the line to LocalSettings.php, the mediawiki fails to load completely. Without this line it works fine but no Issuertracker of course. Tried both syntaxes. Does anyone know why?

# Issue Tracker **********
# require_once $IP . '/extensions/IssueTracker/IssueTracker.php';
require_once( "$IP/extensions/IssueTracker/IssueTracker.php" );

permissions are all set to 777 for the extensions directory and issue_tracker table exists in database.

I had to comment out the following lines in IssueTracker.php (line 81) & IssueTracker.body.php (line 39)

GitHub repository[edit]

Hey folks

I've copied this extension out of the SVN repo where it was and converted it to a git repository hosted on GitHub. I've applied some of the fixes that people have mentioned, and I'm working on making it a bit more secure and closer to MediaWiki's existing code (such as using MediaWiki's permissions system etc).

If you want a version with the fixes applied, download the tag called "release-1.0.1", otherwise the original is tagged as "release-1.0"

I welcome some help if people are willing to give it :)

[stwalkerster|talk] 16:19, 23 May 2011 (UTC)

The "add" link is broken[edit]

I only installed the IssueTracker normally, without problems, but the "add" link is in red and guides to a blank page. (So I can't do anything with the IssueTracker...)

Got the same error...

Catchable fatal error: Argument 1 passed to UsersPager::__construct() must implement interface IContextSource[edit]

Catchable fatal error: Argument 1 passed to UsersPager::__construct() must implement interface IContextSource, string given,
called in <path>/wiki/extensions/IssueTracker/Actions/IssueTrackerActionAdd.php on line 122 and defined in <path>/wiki/includes/specials/SpecialListusers.php on line 37
I get the error above when trying to add an issue. Anybody have any idea how to fix this?
$users = new UsersPager($group);
Change to:
$users = new UsersPager(null, $group);

Extension breaks MediaWiki, "Call to undefined function wfLoadExtensionMessages()"[edit]

Using Version... MediaWiki 1.21alpha (4f82723) PHP 5.3.3-7+squeeze14 (apache2handler) MySQL 5.1.66-0+squeeze1

When I add the extension to LocalSettings I get the following error in the browser:

[Wed Jan 23 15:39:55 2013] [error] [client] PHP Fatal error:  Call to undefined function
wfLoadExtensionMessages() in /var/www/core/extensions/IssueTracker/IssueTracker.php on line 81, referer:

Anyone have any idea what's going on? Is this extension at this point just abandonware?

Answer: I have same problem too, but i have tried to disable "wfLoadExtensionMessages" in IssueTracker.php and IssueTracker.body.php and it's work for me (i using MediaWiki: 1.21.1,PHP: 5.4.7 (apache2handler) and MySQL: 5.5.27) for your reference please check here and here

This answer worked for me. To be clear, commenting out "wfLoadExtensionMessages" in both IssueTracker.php and IssueTracker.body.php. (Mediawiki 1.22.4, PHP 5.3.10, MySQL 5.5.35)

Update planned ?[edit]

Hi, is there an update for current MW-Versions planned? I think this is a powerful extension that should be used on many MW-platform... --hollosch (talk) 09:22, 29 October 2014 (UTC)

It’s the only one you find for MediaWiki, and it’s a shame it’s not under active developement :-( -- 12:04, 17 January 2015 (UTC)

The Assignee List drop-down only shows the first 50 WIKI users[edit]

If you try to change the assignee of an issue, and the user is further down the list than the default page number, the user will not be shown or selectable. This bug is the result of the default number of users listed on the special page UsersList.

Fix: edit IssueTrackerActionAdd.php, insert a line in _getUsers() function to read like this:

 $users = new UsersPager($group);
Change to:
 $users = new UsersPager($group);

IssueTracker breaks Special:SpecialPages[edit]

I am running MW 1.25alpha and IssueTracker works. The only problem is that it breaks Special:SpecialPages with the below error. Anybody knows how to fix this?


[error] [4d8a1090] /wiki-1.25/index.php/Special:SpecialPages  ErrorException from line 257 of /var/www/html/wiki-1.25/includes/exception/MWExceptionHandler.php: Fatal Error: Call to undefined method   IssueTrackerConfig::get()
#0 [internal function]: MWExceptionHandler::handleFatalError()
#1 {main}

Apache error:

[Mon Jan 19 09:33:13 2015] [error] [client x.x.x.x] PHP Fatal error:  Call to undefined method IssueTrackerConfig::get() in /var/www/html/wiki-1.25/includes/specialpage/SpecialPage.php on line 644

Our workaround was to add the following function to the bottom of IssueTracker.config.php, just before the last curly bracket.

       public function get()
          return array();

Call to undefined function wfMsg() in IssueTracker/IssueTracker.php on line 81[edit]

In Mediawiki 1.27 wfMsg() has been removed. So you need to replace all references of

   wfMsg( 'key' ); 
   wfMessage( 'key' )->text();