PDA

View Full Version : vBulletin Project Tools - Project Tools - Create Project Managers who get PM on New or Replies to issues


Quarterbore
08-14-2007, 10:00 PM
I am a new customer to vBulletin Project tools but I was very disapointed to discover that there was no notification when a new issue was added or replied to in vBulletin Projects.

What does this do?

This modification will create a new field in your projects database where "project managers" as determined by their username is stored. These "project managers" will get PMs when a new issue is added to the system and/or they will get a PM when a reply is posted to a topic that they are the project manager for.

How do I install this?

Step 1: Download the attached product file and install it like you install any vBulletin product file.

Step 2: Then you need to perform the following code edits:

OPEN FILE: admincp/projects.php

FIND:

if ($_POST['do'] == 'projectupdate')
{
$vbulletin->input->clean_array_gpc('p', array(
'projectid' => TYPE_UINT,
'displayorder' => TYPE_UINT,
'title' => TYPE_STR,
'summary' => TYPE_STR,
'description' => TYPE_STR,
'startstatus' => TYPE_ARRAY_UINT,
'permissionbase' => TYPE_UINT,
'options' => TYPE_ARRAY_UINT,
'afterforumids' => TYPE_ARRAY_UINT,
'forumtitle' => TYPE_STR
));

REPLACE WITH

if ($_POST['do'] == 'projectupdate')
{
$vbulletin->input->clean_array_gpc('p', array(
'projectid' => TYPE_UINT,
'displayorder' => TYPE_UINT,
'title' => TYPE_STR,
'summary' => TYPE_STR,
'managers' => TYPE_STR,
'description' => TYPE_STR,
'startstatus' => TYPE_ARRAY_UINT,
'permissionbase' => TYPE_UINT,
'options' => TYPE_ARRAY_UINT,
'afterforumids' => TYPE_ARRAY_UINT,
'forumtitle' => TYPE_STR
));

FIND

$projectdata->set('displayorder', $vbulletin->GPC['displayorder']);
$projectdata->set('title', $vbulletin->GPC['title']);
$projectdata->set('summary', $vbulletin->GPC['summary']);
$projectdata->set('description', $vbulletin->GPC['description']);
$projectdata->set('options', array_sum($vbulletin->GPC['options']));
$projectdata->set('afterforumids', implode(',', $vbulletin->GPC['afterforumids']));
$projectdata->set('forumtitle', $vbulletin->GPC['forumtitle']);

REPLACE WITH:

$projectdata->set('displayorder', $vbulletin->GPC['displayorder']);
$projectdata->set('title', $vbulletin->GPC['title']);
$projectdata->set('summary', $vbulletin->GPC['summary']);
$projectdata->set('managers', $vbulletin->GPC['managers']);
$projectdata->set('description', $vbulletin->GPC['description']);
$projectdata->set('options', array_sum($vbulletin->GPC['options']));
$projectdata->set('afterforumids', implode(',', $vbulletin->GPC['afterforumids']));
$projectdata->set('forumtitle', $vbulletin->GPC['forumtitle']);

FIND

print_input_row($vbphrase['title_in_forum_list'], 'forumtitle', $project['forumtitle']);

AFTER ADD

// ADD PROJECT MANAGERS START
print_textarea_row("$vbphrase[vbproject_managers]<dfn>$vbphrase[vbproject_one_name_per_line]</dfn>", 'managers', $project['managers'], 6, 60);
// ADD PROJECT MANAGERS END


OPEN FILE: includes/class_dm_pt_project.php

FIND:

var $validfields = array(
'projectid' => array(TYPE_UINT, REQ_INCR),
'displayorder' => array(TYPE_UINT, REQ_NO),
'title' => array(TYPE_STR, REQ_YES),
'title_clean' => array(TYPE_NOHTMLCOND, REQ_AUTO),
'summary' => array(TYPE_STR, REQ_NO),
'summary_clean' => array(TYPE_NOHTMLCOND, REQ_AUTO),
'description' => array(TYPE_STR, REQ_NO),
'options' => array(TYPE_UINT, REQ_NO),
'afterforumids' => array(TYPE_STR, REQ_NO, VF_METHOD, 'verify_commalist'),
'forumtitle' => array(TYPE_STR, REQ_NO)
);

REPLACE WITH:

var $validfields = array(
'projectid' => array(TYPE_UINT, REQ_INCR),
'displayorder' => array(TYPE_UINT, REQ_NO),
'title' => array(TYPE_STR, REQ_YES),
'title_clean' => array(TYPE_NOHTMLCOND, REQ_AUTO),
'summary' => array(TYPE_STR, REQ_NO),
'managers' => array(TYPE_STR, REQ_NO),
'summary_clean' => array(TYPE_NOHTMLCOND, REQ_AUTO),
'description' => array(TYPE_STR, REQ_NO),
'options' => array(TYPE_UINT, REQ_NO),
'afterforumids' => array(TYPE_STR, REQ_NO, VF_METHOD, 'verify_commalist'),
'forumtitle' => array(TYPE_STR, REQ_NO)
);

Please note, I am posting this early as I need this capability for my own site and I am hoping to get some feedback on how I can improve this. I just coded it this evening and I only have one vBulletin Projects license so I have only tested this on my one site but I believe this should work for anyone...

Version History:
Version 1.0
- First Release
Version 1.1
- Now a project manager will not get a PM about their OWN new posts or replies to posts.

Quarterbore
08-15-2007, 03:28 AM
Reserved for version history or ???

jgommel
08-15-2007, 04:45 AM
I'm receiving the following error when I try to access the Project Manager under the Admincp > Project Toosl > Project Manager

Parse error: syntax error, unexpected T_STRING in /home/neosmutc/public_html/vb/admincp/project.php on line 2282

Quarterbore
08-15-2007, 11:10 AM
I'm receiving the following error when I try to access the Project Manager under the Admincp > Project Toosl > Project Manager

Parse error: syntax error, unexpected T_STRING in /home/----------------------/admincp/project.php on line 2282

Can you confirm your code edits? Your error is in the area where you needed to add the "managers" value to the "clean array" function so I assume you have a typo.

The code hack is the first set of FIND and REPLACE posted above in the /admincp/project.php file.

The code on your site should look like this:

// ################################################## ######################

if ($_POST['do'] == 'projectupdate')
{
$vbulletin->input->clean_array_gpc('p', array(
'projectid' => TYPE_UINT,
'displayorder' => TYPE_UINT,
'title' => TYPE_STR,
'summary' => TYPE_STR,
'managers' => TYPE_STR,
'description' => TYPE_STR,
'startstatus' => TYPE_ARRAY_UINT,
'permissionbase' => TYPE_UINT,
'options' => TYPE_ARRAY_UINT,
'afterforumids' => TYPE_ARRAY_UINT,
'forumtitle' => TYPE_STR
));

if (empty($vbulletin->GPC['title']))

jgommel
08-15-2007, 10:36 PM
What file versions are you editing? I was able to re-apply the the file edits and import the project xml, but I don't see anything when editing or adding a project.

My project.php file version is: RCS: $Revision: 17792 $
My class_dm_pt_project.php file version is: RCS: $Revision: 17792 $

Quarterbore
08-15-2007, 11:12 PM
Hmmm, looks like I forgot to add a file edit...

I have updated the directions in the original post. Note that I added the code where it says "ADD AFTER" and this will give you a field where you can actually add the Project Managers.

Sorry for the confusion!

Reeve of shinra
08-16-2007, 01:26 AM
This is a very userful add-on. Thanks!

Quarterbore
08-16-2007, 09:04 PM
OK, I updated the script so that now it will check if the new topic or the reply to the topic was posted by one of project managers. If the post was made by one of the project managers, that project manager will now NOT get a notification that they posted a new topic or reply :erm:

jgommel
08-20-2007, 02:19 AM
I narrowed this issue down to this mod...

When assigning a username to a Task or a Feature, I get the following Fatal Error:

Fatal error:

* Invalid recipient username. Please press the back button, enter the correct username and try again. Click Here to See the Members List

Unable to proceed with save while $errors array is not empty in class vb_datamanager_pm in /includes/class_dm.php on line 765

What's strange is that the user still ends up being assigned to the Task or Feature?!?! So far, this only appears to be an issue with Task and Feature Assignment. I don't see the error on Bug Assignments.

If I disable the mod, all's well.

Quarterbore
08-24-2007, 01:20 AM
I am traveling this week and I can't look at this here. I will look at it when I get back home (my work laptop is limited)...

jerrygapinski
09-19-2007, 06:20 PM
Hi

Thanks for the add-on. Anyway to have more custom subjects in the PM? Like the title of the post? I was able to customize the static text via the phrase manager. Also, anyway to differentiate subjects between the initial post and replies?

Thanks, Jerry

Lionel
10-14-2007, 11:51 AM
I am hoping to get some feedback on how I can improve this.

Well I have 2 suggestions:

1-Now that we have managers per category, why not auto assign the project to them in addition of sending PM?

2-In admincp, instead of having to type the names, why not use the same pre polutated javascript box when assigning managers?

Cars2007
12-03-2007, 07:35 PM
OK, I updated the script so that now it will check if the new topic or the reply to the topic was posted by one of project managers. If the post was made by one of the project managers, that project manager will now NOT get a notification that they posted a new topic or reply :erm:I changed my own copy back to do that anyway, so it works more like JIRA. Would be nice to have this as an option if you have time in some future release.

Thanks, by the way! PT sorely needs this functionality.

wcm
12-07-2007, 12:08 PM
Great mod!

1. Can you add an option to get instant notification via email directly instead of the PM?
2. It would also be nice if you could include the title of the issue and perhaps some of the text included in the PM/email.
3. A direct link to the issue would also be great.

Pudelwerfer
12-07-2007, 12:32 PM
First: many thanks for your work quarterbore :up::up::up:

Great mod!

1. Can you add an option to get instant notification via email directly instead of the PM?
2. It would also be nice if you could include the title of the issue and perhaps some of the text included in the PM/email.
3. A direct link to the issue would also be great.

It would be a brilliant extension for this mod - i agree to wcm -

This could be very useful.

---
and please sorry for my english ...

qdin
01-17-2008, 03:22 AM
thanx a lot

CyberRanger
10-02-2008, 12:46 PM
One issue I've found is I was getting this error:

Fatal error:

* Too many recipients - you are attempting to send to 7 users but you are only allowed to send to 5 users.

Unable to proceed with save while $errors array is not empty in class vb_datamanager_pm in [path]/includes/class_dm.php on line 810

The problem is that an unlimited number of users can be set to receive a project tool PM. However, vbulletin only allows a PM to be addressed to 5 users. So ... the error comes since I had 7 project managers listed.

towermatt
11-14-2008, 06:33 PM
You can up how many PM's people can send out at once.

I would love it if this thing only sent the PM's to the people the task was assigned to. We have private tasks in some projects and you have to make everyone involved a "manager" at the project level.

But thanks for the great mod, it really helps.

Pudelwerfer
11-17-2009, 06:49 PM
Long Time Ago

Has anyone a Solution or a tip for my and others old old Question?

Great mod!

1. Can you add an option to get instant notification via email directly instead of the PM?
2. It would also be nice if you could include the title of the issue and perhaps some of the text included in the PM/email.
3. A direct link to the issue would also be great.


Or is there a way to put the text of the issue in the PM?

-----

Any ideas are welcome - Thank you for your help!

MJ

Please sorry for my english!

ClipBucket
01-15-2010, 03:33 AM
Great mod!

1. Can you add an option to get instant notification via email directly instead of the PM?
2. It would also be nice if you could include the title of the issue and perhaps some of the text included in the PM/email.
3. A direct link to the issue would also be great.
Your message is three years old, but most likely still unresolved.

I began work on this out of necessity.
I've implemented all three options, though the values are hard coded at the moment.
I'll try to post the code this week; if I can find time.