Results 1 to 4 of 4

Thread: Project Task Hierarchy & SubPanels

  1. #1
    ndrtek is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default Project Task Hierarchy & SubPanels

    So I see in the project_task table... there is a field for "parent_task_id"... which ostensibly is to be used to create a hierarchy of project tasks.

    However, when I include that field in my edit layout... it is only a plain text field... with no "select" lookup for other tasks within the same project.

    So, that would be a shortcoming... what am I to do... remember the task ID I assigned to the parent task? I don't like the idea of the custom "task_id" field to begin with (am I just to number them mysefl?) so I've removed it from the edit layout.

    At any rate... to achieve the hierarchy a different way, I created a one to many relationship project_task => project_task....

    This gives me a "select" lookup (although not filtered for the current project )... in my edit view that is labeled "Parent Task"... and a sub-panel in my detail view that is also labeled "Parent Task"....

    I want to change the label of the sub-panel to "Child Tasks"... while retaining the label in the Edit View... is this possible?

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Project Task Hierarchy & SubPanels

    I haven't done this exact thing but something similar. You'll want to copy how assigned_user_id, assigned_user_link, and assigned_user_name works. In your case it would be parent_task_id, parent_task_link, and parent_task_name. Check out the vardefs.php file in that module's folder to get a feel for it:

    PHP Code:
      'assigned_user_link' =>
      array (
            
    'name' => 'assigned_user_link',
        
    'type' => 'link',
        
    'relationship' => 'project_tasks_assigned_user',
        
    'vname' => 'LBL_ASSIGNED_TO_USER',
        
    'link_type' => 'one',
        
    'module'=>'Users',
        
    'bean_name'=>'User',
        
    'source'=>'non-db',
      ),
    'assigned_user_name' =>
    array (
        
    'name' => 'assigned_user_name',
        
    'rname' => 'user_name',
        
    'id_name' => 'assigned_user_id',
        
    'vname' => 'LBL_ASSIGNED_USER_NAME',
        
    'type' => 'relate',
        
    'table' => 'users',
        
    'module' => 'Users',
        
    'dbType' => 'varchar',
        
    'link'=>'users',
        
    'len' => '255',
        
    'source'=>'non-db',
        ), 
    Changing this around should eventually get what you need.

    Good luck!

  3. #3
    ndrtek is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default Re: Project Task Hierarchy & SubPanels

    Hey eggsurplus...

    Thanks... I can see understanding the vardefs.php files will be central to executing quick customizations.

    I played around a bit per your guidance, and was able to get a select option on Project Task through that method.

    Essentially, it provided the same result as my creating the extra one to many in Studio... but I suppose your suggestion is better because it will utilize the existing parent_task_id field instead of creating custom tables.

    I wonder if you might point me to the files where I can customize what shows up in that pop up select window...

    1) How can I control the list? I'd like to set a default filter for all tasks related to the current task's project.

    2) How can I control the available search fields?

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Project Task Hierarchy & SubPanels

    There should be a popupdefs.php in the metadata directory of the module. If you copy that over to the custom/modules/MODULE/metadata folder (if it doesn't already exist) you can create your popup customizations there. I'm not sure on the default filter question but I've seen others on the forum do the same thing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 2009-05-27, 01:36 PM
  2. Problem when I crete a Project Task and Assigning to a Project.
    By rollno51 in forum General Discussion
    Replies: 0
    Last Post: 2007-07-26, 09:01 AM
  3. Project Task: how to notify to task creator
    By Lamorack in forum Developer Help
    Replies: 0
    Last Post: 2007-04-11, 09:36 AM
  4. Replies: 0
    Last Post: 2006-06-23, 04:41 PM
  5. Replies: 0
    Last Post: 2005-08-19, 08:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •