Download & Extend

Get only non-assigned to-do in view

Project:To do list
Version:6.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi,

I have a little problem between views and to_do list modules. I would like to create a block with only non-assigned to-do items. I create my view, and would like to add a filter on the assigned users but it seems no filter like this exists...
Idem in relations... there is a correct "To do assigned users" relation but I can't say "only if assigned users doesn't exists". I can only said "only if assigned users exists" with the checkbox.

Is there any possibility to get only non-assigned to-do items with any "trick" in the view module ?

Thanks in advance

Comments

#1

Hi Titouille,

The ToDo items are expected to always be assigned. The only way for them to not be assigned to at least one person is to assign to a user that your subsequently delete. There is a bug in that though since the ToDo item should then be assigned to user #1 automatically (or some other users that you choose in the settings, but that other user could also be deleted...)

Thank you.
Alexis

#2

I made some changes on the module to bypass this need because I need a to-do task with a "register" button that any user can click to register to the task. Once the task is affected, no other user can register to it. But it's the user that choose tasks he want to work on, because task are pre-filled by admin...
This is the reason of my request, but I modified my page to display all started todo, assigned or not.

#3

Feel free to share your changes (if you can) to have a chance to see them incorporated in the module.

Thank you.
Alexis

#4

Hi Alexis,

My changes is a simple bad hack... I commented lines 275 - 276 in the to_do.pages.inc to avoid the test of "no user assignment".
After that I added a contemplate file template with some additions to display a "register" button while no user been registred to the task. To register an user, I use the following code :

<?php
   
global $user;

   
module_load_include('pages.inc', 'to_do');
   
$users[$user->uid] = $user->name;
   
$n = new StdClass();
   
$n->nid = $nid;
   
$n->vid = $vid;
   
$n->assigned_users = $users;
   
$n->self = 0;
   
$n->format = 1;
   
_to_do_save_users( $n );
?>

In my case, I develop an og system website to have multiples groups who works on different themes. Each group has an administrator who can create task, and each member can assign itself to a task (in most case a task match a book section reading to create a resume).

Now, in my site, an "administrator" can create a task without any assigned user, and users can register to the task at any time, while the task has no user registered. When a user assign a task to itself, he can create a "story" content to add the resume.

To add some features to the todo module, it would be possible to have :

1. task with no user, any user with the "register to task" access can register to any task by clicking a "register" button
2. limit the assigned users (ie : max = 4 by task, 0 to don't limit)
3. override the "no user assignment" and the "limit" in the to-do creation form

I don't know if it's interesting for this module but I think in organic groups websites it would be helpful.

nobody click here