avatar PNL Pro Jul 1. 2009. 9:47 am
Hello,

When you see all open tickets, is there a way to add some columns (such as the date) and/or to sort them by date ?

Thanks
avatar Ilija Studen Staff Jul 1. 2009. 9:56 am
Hi PNL,

Sorry, there is no way (unless you hack the code, of course) to add new columns to tickets page. Currently, only way to sort tickets is to drag and drop them into position you want - other types of sorting are not available.
avatar emmanuel.lebeul Pro Jul 7. 2009. 11:13 am
Does ActiveCollab team plan to add this sort functionality on the existing columns (priority, start, ticket number, name) ?
If so, when ?
avatar Ilija Studen Staff Jul 7. 2009. 11:49 am
We'll consider it, but I can't promise anything at this point.
avatar emmanuel.lebeul Pro Jul 7. 2009. 12:01 pm
Thank you to consider it.

Is there a road map of the release to come (version, content) ?
avatar Ilija Studen Staff Jul 7. 2009. 12:02 pm
Sorry, we do not publish roadmap or discuss upcoming features until they are at least ready for beta test.
avatar PNL Pro Jul 10. 2009. 10:25 am
Hi there !

We decided to hack the code to add a date + author column for the ticket list in activeCollab. We also sorted these tickets by date. See attached image (below) to figure out how it looks like. Here are the hacks:

HOW TO SORT THE TICKET LIST BY DATE ?

In the following file:
./application/modules/tickets/models/tickets/Tickets.class.php
Change the 'order' line by adding ", created_on DESC, updated_on DESC". The result should look like:

    function findOpenByProject($project, $min_state = STATE_VISIBLE, $min_visibility = VISIBILITY_NORMAL) {
      return ProjectObjects::find(array(
        'conditions' => array('project_id = ? AND type = ? AND state >= ? AND visibility >= ? AND completed_on IS NULL', $project->getId(), 'Ticket', $min_state, $min_visibility),
        'order' => 'ISNULL(position) ASC, created_on DESC, updated_on DESC, position, priority DESC',
      ));
    } // findOpenByProject



HOW TO ADD THE DATE and AUTHOR COLUMN IN THE TICKET LIST ?

In the following file:
./application/modules/tickets/views/tickets/index.tpl

Add this (line 45):
<span class="option ticket_id">{$ticket->getCreatedOn()|string2shortdate}</span>


Add this (line 56): (what an awful inline style !)
<br><span class="option" style='color:#AAA;font-size:0.8em;float:right;'>
{$ticket->getCreatedByName()}</span>


HOW TO DISPLAY A SHORTER DATE IN THE TICKET LIST ?

In the following directory:
./activecollab/angie/classes/smarty/plugins

Create a file named "modifier.string2shortdate.php"
This file should contain this:

<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty string2shortdate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     string2shortdate<br>
 * Purpose:  displays DD MM YY from a date like YYYY-MM-DD HH:MM:ss
 * @author  PNL 
 * @param string
 * @return string
 */

function smarty_modifier_string2shortdate($string, $string2)
{
    // French format: DD MM YY
    return preg_replace('/\d\d(\d+)-(\d+)-(\d+) .*$/i','$3/$2/$1', $string);
    // if you want an English formatted date MM DD YY, use the following line:
    // return preg_replace('/\d\d(\d+)-(\d+)-(\d+) .*$/i','$2/$3/$1', $string);
}

?>