Request

New method for filtering

Summary

open
May 30, 2007
May 30, 2007 / oyvind.kinsey
Mar 22, 2009 / pixtur
 

Attached files

No files uploaded
 
In stead of having to choose between open, my open, for milestone etc, one should be able to combine.
Mainly we have All, For Milestone and Without Milestone, which we should be able to combine with open, my open closed etc.
In addition, if one is a Project Manager, one can also set 'for member xxx'.

This would be much more powerful than the current solution.

8 Comments

xl:yes

10 years ago

this would be a great improvement, together with the possibility to set presets (like now) this would win my gold medal.

oyvind.kinsey:Here is how I did it

10 years ago (2. update 10 years ago)

Just a combination of the existing filters

from /pages/project_more.inc.php

        ### my open tasks for milestone###
        'my_open_tasks_for_milestone' => array(
            'name'=> __('my open, for milestone'),
            'filter_empty_folders'=>true,
            'filters'=> array(
                'task_status'=> array(
                    'id'        => 'task_status',
                    'visible'   => false,
                    'active'    => true,
                    'values'    => array( STATUS_OPEN),
                    'min'       => STATUS_OPEN,
                    'max'       => STATUS_COMPLETED,
                ),
                'for_milestone'   => array(
                    'id'        => 'for_milestone',
                    'visible'   => true,
                    'active'    => true,
                    'value'     => $for_milestone,
                ),
                'assigned_to'   => array(
                    'id'        => 'assigned_to',
                    'visible'   => true,
                    'active'    => true,
                    'value'    =>  $auth->cur_user->id,
                ),


            ),
            'list_settings' => array(
                'tasks' =>array(
                    'hide_columns'  => array(
                        ''
                    ),
                    'style'=> 'list',
                )
            ),
            'new_task_options'=> array(
                'task_assign_to_0'=> $auth->cur_user->id,
            ),

        ),

oyvind.kinsey:

10 years ago

Any particular reason why the codeblock failed to work, and why I am unable to edit my own comment?

tino:Hey Sean

10 years ago

you must type [code] instead of [ code]

To edit your comment, just click on the headline of the comment and then you are able to edit it (hope I got you right)

oyvind.kinsey:Ah..

10 years ago

Earlier there was an edit button in the left margin. (right?)
About the [ code], this was actually copied from the wiki, so maybe this should be fixed?

tino:Reply to Ah..

10 years ago

I agree with you in both points

guest:an idea

9 years ago (2. update 9 years ago) -

thx for this comment, long time I looked for this.

I made some additional change to avoid loosing custom filter if I update streber.

first I added something like that after the presets defintion in projTaskView in project_more.inc.php

from project_more.inc.php

        if ( file_exists( CUSTOMFILTERFILE ) ) {
                include CUSTOMFILTERFILE;

                $presets = $presets + $customTaskFilters;
        }

Then I defined the constant in customize.inc.php

from customize.inc.php

define( 'CUSTOMFILTERFILE' , 'conf/cust_filter.php' );

and last but not least I wrote some custom filters into conf/cust_filter.php.

from conf/cust_filter.php

$customTaskFilters = array (
        ### my open tasks for milestone###
        'my_open_tasks_for_milestone' => array(
            'name'=> __('meine offenen im MS'),
            'filter_empty_folders'=>true,
            'filters'=> array(
                'task_status'=> array(
                    'id'        => 'task_status',
                    'visible'   => false,
                    'active'    => true,
                    'values'    => array( STATUS_NEW, STATUS_OPEN,STATUS_BLOCKED, STATUS_COMPLETED ),
                    'min'       => STATUS_NEW,
                    'max'       => STATUS_COMPLETED,
                ),
                'for_milestone'   => array(
                    'id'        => 'for_milestone',
                    'visible'   => true,
                    'active'    => true,
                    'value'     => $for_milestone,
                ),
                'assigned_to'   => array(
                    'id'        => 'assigned_to',
                    'visible'   => true,
                    'active'    => true,
                    'value'    =>  $auth->cur_user->id,
                ),
            ),
            'list_settings' => array(
                'tasks' =>array(
                    'hide_columns'  => array(
                        ''
                    ),
                    'style'=> 'list',
                )
            ),
            'new_task_options'=> array(
                'task_assign_to_0'=> $auth->cur_user->id,
            ),
        ),
);


pixtur:interesting solution :)

9 years ago