alexmonteiro / Redmine-Monitoring-Controlling

Redmine Plugin that works with Highcharts to show tasks on project throught Charts.
Other
132 stars 77 forks source link

Filter out unused issue statuses. #34

Open fredsdc opened 12 years ago

fredsdc commented 12 years ago

On a given project and subproject you have issues, and these issues have statuses. Other issues not used by the project can have their own statuses, and with this you can create a lot of different workflows on Redmine.

The RMC plugin should filter out unused issue statuses on a given project and subprojects.

Thank you.

Fred.

alexmonteiro commented 12 years ago

On bar chart you can remove statuses from the chart by clicking on statuses legend. Do you mean if the statuses are count 0 it shouldn't appear on the chart?

alexmonteiro commented 12 years ago

The statuses of a project include the sub-projects too because with the count of issues are of the project with the sub-projects.

fredsdc commented 12 years ago

Hi,

I found a solution, but no. I mean completely unused statuses, on projects and their subprojects. Let's say on one project tree I have a very specific workflow for programs (new, design, approval, publishing, done) and on another a workflow for building and selling houses (design, blueprint, foundation, walls, roof, on sale, done). I would like to filter out statuses that don't apply on one project and subprojects.

I made a quick and dirty solution on the sql query, maybe I should have created some filter variable but I don't know ruby very well.

Instead of getting all issues, I determined which are used on the project and subprojects and filter by them. It can get some pretty ugly graphics on projects with no members (and no roles) or trackers assigned on configuration but it is working.

I forked your git v0.1.1 and altered lines 29 to 39. The result is in:

https://github.com/fredsdc/Redmine-Monitoring-Controlling/blob/master/app/controllers/home_monitoring_controlling_project_controller.rb

Best regards,

Fred.

fredsdc commented 12 years ago

Hello,

I changed mc_human_resource_mgmt_project_controller.rb as well.

Best Regards,

Fred

fredsdc commented 12 years ago

Thought about implementing statuses_filters.

In settings you could have a choice of default to all statuses, or only statuses used in the project (and subprojects).

The variable statuses filters would be equal to:

[only used in projects and subprojects (maybe projects selected)] SELECT new_status_id AS statuses FROM workflows WHERE role_id IN (SELECT DISTINCT role_id FROM member_roles WHERE member_id IN (SELECT DISTINCT id FROM members WHERE project_id IN (#{stringSqlProjectsSubPorjects}))) AND tracker_id IN (SELECT DISTINCT tracker_id FROM projects_trackers WHERE project_id IN (#{stringSqlProjectsSubPorjects})) UNION SELECT old_status_id FROM workflows WHERE role_id IN (SELECT DISTINCT role_id FROM member_roles WHERE member_id IN (SELECT DISTINCT id FROM members WHERE project_id IN (#{stringSqlProjectsSubPorjects}))) AND tracker_id IN (SELECT DISTINCT tracker_id FROM projects_trackers WHERE project_id IN (#{stringSqlProjectsSubPorjects}));

or

[All statuses] Select id as statuses from issue_statuses;

On controller home_monitoring_controlling_project_controller.rb, append on line "@statuses = ..." after "from issue_statuses": where id in (#{statuses_filters})

On controller mc_human_resource_mgmt_project_controller.rb append on line "@statusesByAssigneds = ..." after "project_id IN (#{stringSqlProjectsSubProjects})": AND issue_statuses.id IN (#{statuses_filters})

Somewhere there would be a checkbox list to filter out/in selected statuses from variable statuses_filters which would recalculate everything.

I didn't apply this filter to other statistics, but it would be like the append lines described.

Best Regards,

Fred

alexmonteiro commented 12 years ago

I'll check it as soon as possible. Thanx for reporting.

jniggemann commented 12 years ago

Just installed this plugin, thank you Alex, it's really great! I noticed that unused tracker statuses are displayed and wanted to file a issue when I realized there's already this one :-)

While waiting for a fix I applied Freds patch to home_monitoring_controlling_project_controller.rb... Keep up the good work!!

alexmonteiro commented 12 years ago

@fredsdc can you push home_monitoring_controlling_project_controller.rb changes, if you request push I can see changes and apply to main project. Thanks for helping.

fredsdc commented 12 years ago

There's also a patch for mc_human_resource_mgmt_project_controller.rbYou're welcome. Alex work was great!Frederico Souza da Camara SUPOP/OPGSM - Divisão de Planejamento e Implantação Serpro - #61 2021-8341Em 06/07/2012 às 08:59 horas, "Jan" reply@reply.github.com escreveu:Just installed this plugin, thank you Alex, it's really great!I noticed that unused tracker statuses are displayed and wanted to file a issue when I realized there's already this one :-)While waiting for a fix I applied Freds patch to home_monitoring_controlling_project_controller.rb...Keep up the good work!!---Reply to this email directly or view it on GitHub:github.com/alexmonteiro/Redmine-Monitoring-Controlling/issues/34#issuecomment-6803200

"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente a seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente, esclarecendo o equívoco." "This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a government company established under Brazilian law (5.615/70) -- is directed exclusively to its addressee and may contain confidential data, protected under professional secrecy rules. Its unauthorized use is illegal and may subject the transgressor to the law's penalties. If you're not the addressee, please send it back, elucidating the failure."

jniggemann commented 12 years ago

Cool you're working on this! I don't need mc_human_resource_mgmt_project_controller.rb at the moment, but I'm sure that it'll come up later ;-)

jniggemann commented 12 years ago

@fredsdc: You have typos in mc_human_resource_mgmt_project_controller.rb s/Porjects/Projects/g fixed the issue...

fredsdc commented 12 years ago

Oh sorry,I did two versions of these corrections. One for version 0.3 which this typos permeated the whole plugin (we're using this version), and one for version 1.0.1 in which these typos were corrected (to upload). I must have mixed up the diffs, thank you for the correction.Updated.Best regards,Frederico Souza da Camara SUPOP/OPGSM - Divisão de Planejamento e Implantação Serpro - #61 2021-8341Em 06/07/2012 às 12:45 horas, "Jan" reply@reply.github.com escreveu:@fredsdc: You have typos in mc_human_resource_mgmt_project_controller.rbs/Porjects/Projects/g fixed the issue...---Reply to this email directly or view it on GitHub:github.com/alexmonteiro/Redmine-Monitoring-Controlling/issues/34#issuecomment-6808565

"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente a seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente, esclarecendo o equívoco." "This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a government company established under Brazilian law (5.615/70) -- is directed exclusively to its addressee and may contain confidential data, protected under professional secrecy rules. Its unauthorized use is illegal and may subject the transgressor to the law's penalties. If you're not the addressee, please send it back, elucidating the failure."