All tasks

We currently have My tasks (dashboard) which lists all tasks assigned (or unassigned) for the logged user. What we miss is a global list ("All tasks") identical to My tasks but regrouping the tasks from all the users.

This would provide a general overview that can be communicated to others.

Quick and dirty hack:
View:
copy file view/dashboard/my\_tasks.php -> all\_tasks.php

replace in all\_tasks.php line:

  $assigned_tasks = $active_project->getUsersTasks(logged_user());

by

$assigned_tasks = $active_project->getCompanyUsersTasks(logged_user());

Controller:
DashboardController.class.php add:

    /**
    * Show milestones and tasks assigned to all users (within company)
    *
    * @param void
    * @return null
    */
    function all_tasks() {
      tpl_assign('active_projects', logged_user()->getActiveProjects());
      $this->setSidebar(get_template_path('my_tasks_sidebar', 'dashboard'));
    } // all_tasks

Model:
Project.class.php add:

    /**
    * Return array of task that are assigned to specific user's company
    *
    * @param User $user
    * @return array
    */
    function getCompanyUsersTasks(User $user) {
      $task_lists = $this->getTaskLists();
      if(!is_array($task_lists)) {
        return false;
      } // if
     
      $task_list_ids = array();
      foreach($task_lists as $task_list) {
        if(!$user->isMemberOfOwnerCompany() && $task_list->isPrivate()) {
          continue;
        } // if
        $task_list_ids[] = $task_list->getId();
      } // if
     
      return ProjectTasks::findAll(array(
        'conditions' => array('`task_list_id` IN (?) AND ((`assigned_to_company_id` = ?) OR (`assigned_to_user_id` = ? AND `assigned_to_company_id` = ?)) AND `completed_on` = ?', $task_list_ids, $user->getCompanyId(), 0, 0, EMPTY_DATETIME),
        'order' => '`order`'
      )); // findAll
    } // getCompanyUsersTasks

I didn't add it to a template yet but the following url provides you then with a complete list
http://your\_baseurl/index.php?c=dashboard&a=all\_tasks

It would be great if you could create a patch file for this changes, then attach it to an issue (either a new one or an existing one if a relevant one exists). Please see http://projectpier.org/patch

I guess to create a patch I need acces to the development environment and subversion. Where are the files?

just tried the hack on my installation: works. I had to put my hands in the provided code because some formatting and characters were messed up by html...but it works :)
Thanks!

I couldn't implement it on the current version.

This is a feature that I need so desperately.

Yep

Works for me. All those php files were buried pretty deep in there.