Hero Inc.

where heroes are an everyday occurrence

Dec-29-2010

Collabtive Help

[Translate to Italian]

With the recent addition of a few sister sites joining the Hero Inc. hosting family, I’ve needed a “ticketing” system in order to assist the admins of those sites in opening tasks for my sites and theirs. These tasks could be as simple as creating subdomains or email addresses for new users to building new images for the most recent posts.

Collabtive

The “ticketing” system needed to be simple, easy to integrate, and of course free. After a few simple Google searches, I settled on Collabtive. The install was simple and it ran on MySQL. I was fearful of much of the development and blog posts being in Italian, but Google solved this problem for me.

After working with the Collabtive system, known internal to me as Hero Inc. PMS (yes, insert jokes and laughter here), I found it really did everything I needed. But earlier this week, I found one weakness. It did not notify the person assigning a task or those assigned to a task that it had been closed even when notifications were enabled. Google searches showed that I was not alone in wanting this feature added. With my minor coding background I decided to give the feature a shot. Thankfully the Collabtive team did an amazing job of organizing their code. A few code changes and corrective misspellings in my code later, I had the result that I wanted.

For those interested, here is how you can update your environment to include the following feature updates:

  • Email assigner when a task is created
  • Email assigner and assignees when a task is edited
  • Email assigner and assignees when a task is closed
  • Modify the notification text for the emails sent for created, edited, and closed tasks
  1. Update the Collabtive environment to the latest release. At the time of this post, the latest version is 0.6.5.
  2. Update the Collabtive MySQL database to add a new column, “assigner”, to the “tasks” table. The “assigner” column should be of type Integer just as it is for the user ID.
  3. Update all tasks to contain a default ID for an assigner. This will ensure that when older tasks are closed or edited that Collabtive does not fail in sending notifications.
    UPDATE `tasks` SET assigner= [INSERT DEFAULT USER ID HERE] 
    WHERE assigner = 0 OR assigner IS NULL;
  4. Download the files I modified.
  5. Update your Collabtive directory with the following files in the appropriate location:
    /managetask.php
    /include/class.task.php
    /language/en/lng.conf

For those not using English as the default language, the following additions need to be made to the appropriate lng.conf file:

  • projectassignedsubject
  • projectassignedtext
  • taskassignedsubject
  • taskassignedtext
  • taskassignersubject
  • taskassignertext
  • taskclosedsubject
  • taskupdatedsubject
  • taskupdatedtext

That’s it. The environment is now setup to send the notifications as needed. I’ve tested the changes in my environment and didn’t have any issues. If anyone follows these instructions and encounters issues/bugs, please leave a comment and let me know.

UPDATE NOTE (2011-02-20): I’ve made a recent update to my work stated here. Go here to read more about the latest change.

UPDATE NOTE (2011-02-27): I just realized there was an error in the close task functionality and emails were being sent to the user that has an ID of 1. I’ve updated the code referenced in this post to include a fix for the getAssigner function. Please let me know if you run into any additional issues.

Posted under Internet

Comments

Fernando Castro Says:
January 11th, 2011 at 7:16 am

Excelente, gracias…. excelent… than you i have changed the script following your clear instructions and it works fine….

Fernando

Ben Says:
January 11th, 2011 at 9:28 pm

Glad to hear the instructions worked for someone other than me.

amosis16 Says:
February 9th, 2011 at 3:32 pm

I got tripped up on the SQL query.

UPDATE `tasks` SET assigner= 1
WHERE assigner = 0 OR assigner IS NULL;

will assign everything to the default user

amosis16 Says:
February 9th, 2011 at 4:01 pm

This is a really cool bit of code. I am very happy that I found it. Please forward this to the collabative team.

Dave

Ben Says:
February 9th, 2011 at 10:15 pm

amosis16, The SQL query is written in that way so that all preexisting and opened tasks will have a default user to email. I was just too lazy to perform QA developing/testing to not send emails when no one was listed as the assigner.

I have also passed my code onto the collabtive team. They are free to use it as they see fit. I might perform some additional updates as my own team are asking for feature updates. If I do make changes, I’ll make sure to repost them here and inform the collabtive team.

ben wu Says:
February 14th, 2011 at 9:46 am

very useful for me as well. thanks a lot. I hope the project will include your codes or this feature in the next realease. but for now, I will borrow yours 🙂

GeorKame Says:
February 17th, 2011 at 3:57 pm

I followed instructions and did not work, my question should is where it says to [INSERT DEFAULT USER ID HERE], do I leave it as is or do i put 1 or how do I find out … and how do I chose the value?

Sorry for being a newbie.

Do I need to restart the WAMP services after the changes?

Ben Says:
February 17th, 2011 at 7:03 pm

No worries. We have all been newbs at one point.

Change the [INSERT DEFAULT USER ID HERE] to 1 or whatever the user ID number is for your primary user. This is done just so that any future tasks that are already open will not error when an email is sent. I was just too plain lazy to QA code for that.

No need to restart when you have the changes in place.

GeorKame Says:
February 18th, 2011 at 9:52 am

Thx Ben, i did just that :
UPDATE `tasks` SET assigner= 1
WHERE assigner = 0 OR assigner IS NULL;

(also i used 2 as for now I have 2 users, one is me and the other is admin (BTW I use Active Directory LDAP authentication in Collabtive).

I also added the “assigner” colunm to all 3 tasks tables and are: “tasks” tasks_assigned” & “tasklist”

probably I do not understand what tis should work, i.e., I was expecting if anyone adds, or change a task I would be notified. same for adding projects, or editing them etc…

Thanks for your courteous responses. great work.

GeorKame Says:
February 18th, 2011 at 9:53 am

one more question, can we post PICs in the replies? I would show you better the changes I made via PHPmyadmin.

GeorKame Says:
February 18th, 2011 at 10:12 am

I just went back and only added the assigner to the “tasks” table.

and the main user closed a task, and voila I got notifications, but when I edited the tasks no notifications were sent.

also when I added a mile stone and / or a task also no notifications were sent by email.

GeorKame Says:
February 18th, 2011 at 10:20 am

Now I understand more,

ADMIN is ID user 1
ME is ID user 2

if admin add or complete milestone and / or a tasks emails gets sent out
if admin edit a milestone or a task no emails or notifications get sent out.

for ME none of the notification get sent out, only when a message is sent.

is this how it supposed to work, only for the assigner?

Ben Says:
February 19th, 2011 at 11:53 pm

@GeorKame: The changes I made to the Collabtive code are only for Tasks. I did not make any changes for Milestones or test my changes for Milestones. My team currently only utilizes the Tasks portion of Collabtive.

Here are the cases with my code when emails are sent:
Create Task – Email is sent to person who assigned the task and individuals who are assigned to complete the task.
Edit Task – Email is sent to individuals who are assigned to complete the task.
Close Task – Email is sent to person who assigned the task and individuals who are assigned to complete the task.

Please do not post pics in replies as I have not properly configured my blog to accept them.

Ben Says:
February 20th, 2011 at 12:26 am

As stated in the post above, I’ve made some recent changes that might be interesting to those that enjoyed my work here.

lia Says:
December 13th, 2013 at 4:03 am

Dear all,
can anyone help me, i need to change the content of email notification. I want to change the message and also the subject.
in which file i need to edit?

thanks

Add A Comment

If you would like to track when new comments have been made, subscribe to the Comments Feed.