Tasks with sub-tasks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Obermumpf
    Member
    • Apr 2020
    • 35

    Tasks with sub-tasks

    Hi there,

    is it possible to setup sub-tasks?

    Just like this:

    Task "Build a house"

    Sub-Tasks
    "Get a piece of land"
    "Find architect"
    "Buy bricks"
    "Build"
    "Party"

    Is there a way to do this?
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi,
    Well, you can create a relation between Task to Task of One-to-Many type. Or you can create your own custom entity for sub-tasks and then link it to Task.

    Comment

    • peterberlin
      Active Community Member
      • Mar 2015
      • 1004

      #3
      Maybe that's the solution:

      https://www.youtube.com/watch?v=fvllcGJhKNg

      https://www.eblasoft.com.tr/product-...le-inline-form

      peter

      Comment

      • Obermumpf
        Member
        • Apr 2020
        • 35

        #4
        Originally posted by Maximus
        Hi,
        Well, you can create a relation between Task to Task of One-to-Many type. Or you can create your own custom entity for sub-tasks and then link it to Task.

        This did the trick, thank you. The only "cosmetic" thing I would like to change is: how can I limit the Kanban view to only display tasks that are either standalone tasks with zero relations or main tasks with sub-tasks. That means to hide all tasks that are related to a main task.

        Comment

        • Maximus
          Senior Member
          • Nov 2018
          • 2731

          #5
          > how can I limit the Kanban view to only display tasks that are either standalone tasks with zero relations or main tasks with sub-tasks

          You need to create a custom filter for the list view and use it. Please follow this:
          1. Create the file /custom/Espo/Custom/SelectManagers/Task.php with the code:
          PHP Code:
          <?php
          
          namespace Espo\Custom\SelectManagers;
          
          class Task extends \Espo\Modules\Crm\SelectManagers\Task
          {
              protected function filterNotSubtask(&$result)
              {
          
                  $result['whereClause'][] = [
                      'taskParentId=' => null
                  ];
              }
          }
          2. Add filter to a json file. Open the file /custom/Espo/Custom/Resources/metadata/clientDefs/Task.json and add this block:
          Code:
          {
              ....,
              "filterList": [
                  "__APPEND__",
                  "notSubtask"
              ],
              .....
          }
          3. Change the filter label. Open the file /application/Espo/Modules/Crm/Resources/i18n/en_US/Task.json and add this block:
          Code:
          {
              ....,
              "presetFilters": {
                  "notSubtask": "Not Subtask"
              }
              .....
          }
          4. Administration -> Clear Cache
          5. Refresh a webpage
          6. Select the filter in the list view as it is shown on the screenshot.

          Attached Files

          Comment

          • Obermumpf
            Member
            • Apr 2020
            • 35

            #6
            Oops. Man, I have no clue, I am not a programmer. Is there a simpler way with onboard functions?

            Comment

            • Maximus
              Senior Member
              • Nov 2018
              • 2731

              #7
              Yep, but in another case, you need to use each time the filter conditions manually. Open Administration -> Layout Manager -> Tasks -> Search Filters -> Add 'Sub Tasks' -> Save -> Refresh a web page -> Go to the Task entity list view and use this filter (see screenshot below).
              Attached Files

              Comment


              • esforim
                esforim commented
                Editing a comment
                Just another tip as it is quite hidden away if anyone plan to use these filter in the future. If you click that "All" button, there is a "Save Filter" button, you can use that to retrieve filter in the future.
            • telecastg
              Active Community Member
              • Jun 2018
              • 907

              #8
              Excellent tutorial on how to create custom filters for list record displays Maximus !. Should be incorporated in the documentation if possible

              Comment


              • Maximus
                Maximus commented
                Editing a comment
                Thanks, I appreciate it.
                I'd like to add such branch 'How to .....' to the EspoCRM documentation with real examples. Hope, our CEO accept this improvement request soon, and our team will start to design it.

              • esforim
                esforim commented
                Editing a comment
                Yes, looking forward to it! I like to quite a few thread for future reference that you can refer to or decide on which to start with:

                In the future this thread will be use for discussion; the Wiki hosted on Github will be used instead to post update; please see: https://github.com/o-data/EspoCRM-Learning-and-Design/wiki Part 2 of this post can be found here: https://forum.espocrm.com/forum/gene...5114#post55114 (https://forum.espocrm.com/forum/general/54706
            • esforim
              Active Community Member
              • Jan 2020
              • 2204

              #9
              Missed your chance to plug in the extension telecastg ... shame on you. This extension might be helpful Obermumpf https://github.com/telecastg/dynamic...st-for-espocrm

              But those doesn't look like subtask at all! They look like major task and should be shown on a higher level (either use Opportunity or Case for example).

              I would considered these to be subtask:

              Task: Get contract signed
              Subtask:
              Prepare documents
              Organize signing
              Check and Scan Documents

              For your example you probably want to use:
              Opportunity / Case (I use case instead of opportunity, was foolish of me)

              Opportunity name: Build House for Mr Smith
              (If you are involved in construction or Real Estate I recommend you considering downloading and using the free extension Real Estate)
              Task: Buy land | Subtask: get contract, settlement
              Task: Drawing | Subtask: assigned architect, very drawing; approve drawing


              Some of those subtask might be a higher level (for example it should be Task or sometime even a separate Opportunity) but I just wanted to give an example that may help you with design in long term.

              Comment

              • Obermumpf
                Member
                • Apr 2020
                • 35

                #10
                This is beautiful, but for another thing. In my case, the sub-tasks are more or less quit individual.

                Comment

                • emillod
                  Active Community Member
                  • Apr 2017
                  • 1405

                  #11
                  We had similar issue. We decided to create relation between tasks. So basically there is task, for example "EspoCRM installation" and in this task we can create sub-task with name "Configuration on cronjob" which is later available in relation panel. We even created filters for our task entity which only showing main tasks.

                  We're thinking about creating information about related sub-tasks. + we'll let user to change status of main tasks to completed only if sub-tasks are closed.

                  Comment

                  • telecastg
                    Active Community Member
                    • Jun 2018
                    • 907

                    #12
                    we'll let user to change status of main tasks to completed only if sub-tasks are closed.
                    If the parent task "status" field is enum, you can also use dynamic-handler to limit the options for this dropdown based on the "status" value of the linked sub-tasks.

                    We have experimented using dynamic-handler to make Ajax calls and retrieve data about other entities to control the display of a main entity, it's similar to using a hook but it is all done at the front end.

                    PS: I like your signature design

                    Comment

                    • emillod
                      Active Community Member
                      • Apr 2017
                      • 1405

                      #13
                      Originally posted by telecastg

                      PS: I like your signature design
                      Hah, i like it too, thank you

                      Comment

                      • keda
                        Junior Member
                        • Jul 2021
                        • 28

                        #14
                        Hello everyone,

                        i hope it us ok to post in this slight older topic.

                        My Problem (shown in the screenshot):
                        Inside the Task details i only see the name of the sub task but i have no idea how to add more information from this subtask to this detailed "task view"
                        I added basic fields to my subTask like "status, description"


                        Is it even possible to add more information on this page view? I think i have tried it all

                        Thanks in advance

                        Comment

                        • esforim
                          Active Community Member
                          • Jan 2020
                          • 2204

                          #15
                          Hi keda, there is like 4 option in this thread. Not quite sure which method you end up using...?

                          Comment

                          Working...