[#783] Add capability to edit/add status in PM module (tasks) [previously: Changes to ProjectTaskFactory.class.php breaks handling of custom statuses.]

Description

Summary:

Detailed description

We are using the FusionForge version 5.3.2 .

We are having issue while searching the tasks with our custom status (created by us) as its not working properly. After investigating the issue we found that in file common/pm/ProjectTaskFactory.class.php filtering is being done only in three hard coded status (Open,Closed,Deleted) and not handling the form fields value for the status .

While searching in SCM repository tree for the FusionForge, we found that these code changes were on 2014-01-15 (Franck Villaume).

Below is the url for the commit
<a href="https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge/fusionforge.git;a=commit;h=fbf28f957a98973ed068b4c6d69b8e42ce3a6ffc" target="_blank">https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge/fusionforge.git;a=commit;h=fbf28f957a98973ed068b4c6d69b8e42ce3a6ffc</a>

We request you to suggest an appropriate solution to our original requirement of using custom statuses which we have created by direct insertion to the DB tables. ( in most of places it works fine).

General Information
Submitted by:
nitendra tripathi
Date Submitted: 2015-07-02 08:58
Last Modified by: Nobody
Last Modified: 2017-11-02 20:00
Date Closed: 2015-07-14 08:02
Permalink: https://fusionforge.org/tracker/a_follow.php/783
Actions
Internal Fields
Data Type: Patches
Assigned to: Franck Villaume (nerville)
State: Closed
Priority: 3
Extra Fields
Base branch:
Branch_5_3
Resolution:
Accepted
Follow-up tabs
Message  ↓
Date: 2017-05-19 11:48
Sender: Franck Villaume

https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git&a=search&h=HEAD&st=grep&s=nitendra+

returns 3 matches for your name. Your code is still there, same for your copyright.

Date: 2017-05-19 11:35
Sender: nitendra tripathi

Dear Frank,

This is to bring your kind attention regarding the patch submitted by me and approved by you mentioned in the tracker url below. https://fusionforge.org/tracker/?func=detail&atid=107&aid=783&group_id=6

As per the mail below you mentioned that, You have added my name in appropriate places in your REPO, and i also saw my name in Copywrite , at that time. But now when i am checking the repo, my name is not visible, though the code changes done by me still exists.

I am browsing the repo in the url below . https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge/fusionforge.git;a=commit;h=fbf28f957a98973ed068b4c6d69b8e42ce3a6ffc

I would like to know, is there any problem in my code or you want to remove it in future ?

Date: 2015-07-14 08:01
Sender: Franck Villaume

Hi,

your patch looks good. Thank you for contributing.

Still, it wont land in 5.3 nor 6.0 version, since 5.3 and 6.0 is dedicated to bugfix only. New features land in the forth coming version 6.1.

I merged it into the current master (which will be the 6.1). I added your copyright where it belongs.

Commit id: a091ba7a1c1074673160cdf6416e29cfebf747db

Date: 2015-07-14 05:48
Sender: nitendra tripathi

Dear Franck,

We have reworked on the patch to include support for modifying the data using gforge GUI.

The patch has been tested in our local setup and works as expected

3 features have been done. 1) GUI for adding / editing task statuses in table 'project_statuses' 2) Display of current task status in "browse task" interface 3) Filter in "browse task" on custom statuses.

Since we were unsure about where the feature (1) should have gone, we created it under "Reporting" -> "Administrative" based on the fact that there was a similarly coded functionality of "Manage Time Tracker Categories". As a matter of fact our code is largely based on that feature/file itself.

feature 2,3 have been placed on existing application/file itself.

We request you to kindly review it and tell us how can we proceed to have it added to fusionforge if found suitable.

Date: 2015-07-03 08:51
Sender: Sylvain Beucler

Déplacé de Bugs vers Patches

Date: 2015-07-03 08:51
Sender: Sylvain Beucler

This is not a proper patch.

You need to add a web interface to modify the "Status" field.

Date: 2015-07-03 08:48
Sender: nitendra tripathi

Dear Sylvain,

Please find below the patch

diff --git a/src/common/pm/ProjectTaskFactory.class.php b/src/common/pm/ProjectTaskFactory.class.php index 5e4a2ae..d450e0b 100644 --- a/src/common/pm/ProjectTaskFactory.class.php +++ b/src/common/pm/ProjectTaskFactory.class.php @@ -200,7 +200,7 @@ class ProjectTaskFactory extends Error { array ($this->ProjectGroup->getID())); }

  • if ($this->status == 1 || $this->status == 2 || $this->status == 3) {
  • if ($this->status && ($this->status != 100)) { $qpa = dbconstructqpa($qpa, ' AND projecttaskvw.status_id = $1 ', array($this->status));

}

This patch is created on the repo cloned by the link( https://scm.fusionforge.org/anonscm/git/fusionforge/fusionforge.git )

The commit log in my local repository is as below . We appreciate your encouragement to submit patch to the project.


commit ffc91286b889b84a6423968b66a9944fe9220892 Author: nitendra <nitendra@tradeindia.com> Date: Fri Jul 3 12:57:29 2015 +0530

BUG##783 Changes to ProjectTaskFactory.class.php breaks handling of custom statuses.

Only 3 hard coded statuses were being handled namely 1,2 and 3.
now the code has been reverted (almost to origianl) to handle the
statuses in a generic manner. Improvement has been done against
the original in terms of checking whether $this-&gt;status is really

set or not instead of just comparing against any (100).

Date: 2015-07-02 11:58
Sender: Sylvain Beucler

Hi,

I had understood your problem.

Your change in the database is not supported. If you want, you can revert ProjectTaskFactory.class.php on your installation.

Alterantively, if you have the time, you can send a patch to support customization of the status field.

Date: 2015-07-02 09:51
Sender: nitendra tripathi

Dear Sylvain,

In the most recent commit tree also there are no change in the code segment, which I am discussing about.

below is the snippet (from version 6.0)

203 if ($this->status == 1 || $this->status == 2 || $this->status == 3) { 204 $qpa = dbconstructqpa($qpa, ' AND projecttaskvw.status_id = $1 ', array($this->status));

205 }

One can see that the only three pre defined statuses are being checked.

while going through the commit tree we found in the code prior to the commit (fbf28f957a98973ed068b4c6d69b8e42ce3a6ffc) for status filtering would have handled this situation as there was no predefined status were mentioned. in that version the code in the line (mentioned in code snippet above) was like below

if ($this->status != 100) {

means that if the status is not 100(Any) then respect the values (of status_id )passed through the search form. I hope i have been able to convey my concern more clearly to you.

Date: 2015-07-02 09:18
Sender: Sylvain Beucler

Hi,

A couple preliminary comments :

  • Can you first upgrade to at least 5.3.4 (or possibly 6.0.1!) to check if the problem persist?

  • If you manually edited the database, it's your responsibility to patch the code accordingly. If you need custom statuses you may want to have a look at the Trackers module which is more configurable.

Regards,

Attachments:
Size Name Date By Download
7 KiBcustom_task_statuses.patch2015-07-14 05:48
nitendra tripathi
custom_task_statuses.patch

No related commits.

Field Old Value Date By
status_idOpen2015-07-14 08:02
Franck Villaume
close_dateNone2015-07-14 08:02
Franck Villaume
summaryChanges to ProjectTaskFactory.class.php breaks handling of custom statuses.2015-07-14 08:01
Franck Villaume
ResolutionNone2015-07-14 08:01
Franck Villaume
Target Release5.3.22015-07-14 08:01
Franck Villaume
File Added506: custom_task_statuses.patch2015-07-14 05:48
nitendra tripathi
Base branchNone2015-07-03 12:25
Franck Villaume
assigned_tonone2015-07-03 12:25
Franck Villaume
typeBugs2015-07-03 08:51
Sylvain Beucler
details We are using the FusionForge version 5.3.2 . We are having issue while searching the tasks with our custom status (created by us) as its not working properly. After investigating the issue we found that in file common/pm/ProjectTaskFactory.class.php filtering is being done only in three hard coded status (Open,Closed,Deleted) and not handling the form fields value for the status . While searching in SCM repository tree for the FusionForge, we found that these code changes were on 2014-01-15 (Franck Villaume). Below is the url for the commit https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge/fusionforge.git;a=commit;h=fbf28f957a98973ed068b4c6d69b8e42ce3a6ffc We request you to suggest an appropriate solution to our original requirement of using custom statuses which we have created by direct insertion to the DB tables. ( in most of places it works fine). 2015-07-02 09:18
Sylvain Beucler

No relations found.