| Project: | ProjectPier |
| Version: | 0.8.6-stable |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | phpfreak |
| Status: | closed - fixed |
Suppose it's a good feature to have a comments on tasks!
After googling I found haris.tv
Now it's adapted for current trunk
Overview:
application/controllers/TaskController.class.php
- added - view_task
application/models/project_tasks/ProjectTask.class.php
- enable commendt - $is_commentable = true;
- add permissions - canView
- default view - getViewUrl()
- dashboard link - same getViewUrl()
application/views/task/task_list.php
- added link 'comments: N' for current and completed task_lists
New application/views/task/view_task.php
- Just a view
language/en_us/actions.php
- new line for 'View task'
Second patch with textile formatting added (http://www.projectpier.org/node/260)
This is more complicated because description of task can be big so actions (edit,delete) moved to checkbox area.
Suppose better to move them down to comments and remove icons at all
| Attachment | Size |
|---|---|
| task_comments.patch | 6.7 KB |
| task_comments_textile.patch | 10.35 KB |
Another patch - just comments on tasklist
Hey Andy,
Thanks for making this rad little patch. I'm not sure if I applied the patch incorrect or I'm confused as to which patch is which.
I'm not sure whether I should install all the patches or just one...
* Texttile Patch - Is that for tasklist + tasks?
* Comments Patch - Is that for tasklist + tasks?
* Pastlist Patch - As you mentioned this is to repair the tasklist language issue? I've not really done patches before so if I've already applied one of the other patches which works with tasklist and tasks should I apply this one overtop?
Sorry if this is a no brainer just not entirely sure what order or which ones to apply.
Personaly, I'd love to get both comments on task and tasklist working, but at the moment only tasklist is working?
Thanks for your help!
Hey,
I think that I understand the context of all the patches now - sorry was a bit confused before. But when I apply any of your patches they seem to be rejected (see attachment). Any clues as to why they might be rejected - I'm not using the Beta release so that shouldn't be a problem.
So far I have installed...
* WYSWYG Textile Editor
* Task_comments_textile.patch (rejected)
Any help would be really great thanks as I'm knew at this stuff :)
Shane
I had to patch /application/views/tasks/task_list.php by hand because was in the doc when my original file just had a real space.
Great patch, thank you for adding it.
I tried the patch on 0.8.5.0-beta1 and I'm having trouble with the render_object_comments() function in view_task.php.
No header, breadcrumb or footer is shown on a task comment.
If I comment out the echo render_object_comments() line, the task comment will show up, but without the comment form.
Any idea why?
[EDIT]
Finally checked the server logs and found the root of the problem.
This was the problem:
[Mon Jan 25 23:20:22 2010] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined method ProjectTask::getIsPrivate() in C:\\UniServer2\\www\\projects\\application\\views\\comment\\post_comment_form.php on line 16, referer: http://localhost.localdomain/projects/index.php?c=task&a=index&active_project=50
---
So I looked in /application/models/project_tasks/ProjectTask.class.php and found a similar function called isPrivate().
I simply duplicated this function and renamed it to getIsPrivate() and this fixed the problem.
Hope that helps someone!
Same issue with the view of the comment than post #5 from rayray: I couldn't post any comment, but with the copy/rename of the function IsPrivate() into GetIsPrivate(), it solved the issue.
EDIT: well, only partially: I have issues with permissions for standard users: they can't access the comments...
EDIT2: solved: there was a restriction in TaskController.class.php: onlit the users with the EDIT permission could view the task details.
I've thus replace the condition in the function view_task():
BEFORE:
<?phpif (!$task->canEdit(logged_user())) {
flash_error(lang('no access permissions'));
$this->redirectTo('task');
} // if
?>
AFTER:
<?phpif (!$task_list->canView(logged_user())){
flash_error(lang('no access permissions'));
$this->redirectTo('task');
} // if
?>
And I've done a patch from svn trunk, based on the textile version of the previous patch...
Hope this helps others to solve this issue!
Any hint bu someone on how we could add notifications on new comments?
Should be similar to comments on files or messages no?
Anyone has a pacth yet for that?
So I did add this feature for sending notification emails when comments are posted on tasks, tasklists or files.
I don't know how to generate patches for only some selected features, so you need to first patch with task_comments_textile.patch and pasklist_comments.patch.
My patch basically adds a new notify type for comments that are not messages (these are already managed with the message subscription).
It sends notification of all project users and restrict or owner company if private object...
You´ll have to patch the 3 files from their respective directory:
- application\controllers\CommentController.class.php
- application\models\notifier\Notifier.class.php
- application\views\notifier\new_comment.php
Accepted into 0.8.6 (comments on task, task lists and notifications). Works great (after fixing a few things) ;-)
Hi -
On CommentController.patch i got an error 500 internal server error
Notifier::newOtherComment($comment, $notify_people);
if i remove this line it works but it doesn't send an email. I've double checked my notifier.class.php as well and i have newOtherComment function defined there already.
Any idea why??
The email notification is not working properly. When a comment is posted to a task, email notifications are sent to ALL users of the project, although said users are not party/involved in the task.
The email notification should work the same way as in messages. Email notifications (of comments) are sent only to those who were party to the original message.
I agree. For this feature to be truly useful it needs more work - it would need a similar "checkbox list" as in the new message form, where you can mark who will receive notifications (task owner checked by default). This is also how it works on Basecamp, when you post comments on todo items.
Accepted into 0.8.6
0.8.7 has same notification options as message for comments on task lists and files :-)