Comments

nicoloconte’s picture

Subscribing, I need to add more fields similar to project manager and project assigned to for my work.

Nicolo'

Magnity’s picture

Hi @nicoloconte, please add details about on which storm nodes you'd like the fields and the labels that you'd find useful!

nicoloconte’s picture

Hi,
I made some changes in stormtask and stormticket modules, I created a new field "assigned to" like in stormproject module. Also I made a bug fix in stormticket module, the dateapi function wasn't declared.

Whare con I put this changes?

Nicolo'

Magnity’s picture

Hi Nicolo,

If you ever find a bug in anything - have a look through the existing issues to see if it has been reported already, if it isn't, then create a new issue. It'd be even better too if you could post a patch with the changes you made to fix it.

hixster’s picture

subscribing

Magnity’s picture

Hi @hixster - if you want to mould where the additional fields are added, please add a comment!

bigjim’s picture

even if it were something as simple as what is available in projects I would be psyched for that.

jurgenhaas’s picture

+1 for having at least the ability for asigning tickets and tasks to team members.

hixster’s picture

Seconded, i got tasks assignments to team members working with CCK, but more crossover between users and project oriented tasks and tickets out of the box would be great.

Magnity’s picture

Seems like there is pretty good agreement as summarised well in #8.

A couple of bugs relating to the current 'assign to' fields need ironing out before these go in though:
- #628792: Project titles visible for non-assigned teams
- #622732: It's possible to create a task whose internal logic is not respected

Please have a look at these two if you want this issue to get through faster!

Then a big leap after this issue will be figuring out how to make the permissions hierarchical so solve a few quirks that these expose - such as being able to view a project without being able to view the organization etc.
#585104: Hierarchical permissions contains a bit on that.

gnuwings’s picture

Subscribing

Magnity’s picture

I get the impression that a few people are waiting for this...

Here is where we are at.
1 - The issues I've mentioned in #10 are fixed pending people finding problems
2 - Once we've had a day or so to test those, a 6.x-1.28 will be released.
3 - Then this issue will be done, meaning there will be a good amount of time to check for problems here before the release of 6.x-1.29.

Want to help out?

I'm keen to have more people running the development release. This way, we can more effectively test for errors before the stable releases are made. The best way is to run your production site on the stable release, but to use the development release on your staging site, or a copy of the production site.

Its really important to test the assigned to fields etc due to the access control properties of them.

gnuwings’s picture

@Magnity:
Thanks for the great work. I am ready to test the beta code in my server. I assume the latest code is available here : http://drupal.org/node/253484

gnuwings’s picture

@Magnity
I have tested the storm development version in drupal-6.14.

The project manager field is ideal for the projects module. However, it may be nice if the "Assigned to" field is moved to tasks and tickets. In our organisation, projects are never assigned instead we have project membership. The tasks and tickets are assigned to individual team or groups. I can provide more use cases if required.

Please note that I haven't tested the access control and permission system in storm.

nicoloconte’s picture

#14 it's a great idea.
I implemented these features ("assigned to" for ticket and task) and also I implemented the possibility to send an email to the person assigned.

Magnity’s picture

Title: Create more fields for assigning to users/teams » Assign to fields for tasks and tickets
Category: task » feature
Status: Active » Patch (to be ported)

These fields have now been added to tasks and tickets - D6 development release from midnight tonight.

Needs adding to D7 branch.

gnuwings’s picture

@Magnity
Great work and many thanks for the quick fix.

I have tested the latest version and did some basic testing. Here are the issues which I found:
1. The task/ticket view page doesn't show the name of the assigned user
2. The "Assigned To" field in tickets/tasks edit should list the members from the organization selected. Currently all the users in the system are listed in the "Assigned To" drop-down.
3. The tasks and tickets list should also show the assigned user
4. "Assigned To" field in projects may be removed(retain it only if somebody has a strong reason)
5. May be nice if the following permissions are added:
5.1 Storm Ticket : can assign ticket to any user
5.2 Storm Ticket : can assign tickets to self
5.3 Storm Task : can assign task to any user
5.4 Storm Task : can assign task to self

It may also be nice if you could explain the "PEOPLE" in the "Assigned To" drop-down. I didn't noticed any change when I assigned the task/ticket to "PEOPLE".

nicoloconte’s picture

Great, thank you!
4) In my case is important to have the assigned to field for project.

jurgenhaas’s picture

Thanks @magnity, great work. I have immediately implemented the assign features into Storm Dashboard and this allows filtering for assignments on projects, tasks and tickets.

The latest development release also includes comment form alterations for tasks and tickets that allow the change of the status and the assignment of the task or the ticket.

While doing that I faced the problem mentioned in #17 item 2 above: what people should be displayed as possible assignments. Here is what I came up with:

1) If the project is assigned to a person, only that person is listed as an option
2) If the project is assigned to a teram, all team members are listed as options
3) If the project is not assigned to a person or a team, all people that are assigned to the same origanization as the task/ticket, are listed as options
4) In addition, if the project is assigned to a manager, that person is listed as well

After that I look into all teams and only those teams that exclusively contain members that are selected by step 1-4 above, will also be included as possible options.

That made the most sense to me and I hope it helps others as well. Comments of course welcome.

Magnity’s picture

Thanks to all for posting these comments - I'll have a further look at getting past all of these later on tonight.

gnuwings’s picture

I too agree with the comments posted in #19, especially regarding the values of the "Assigned To" drop-down.

Magnity’s picture

@all, if you do have particular things that you would like to see and have implemented it yourself, please do post the code (a patch preferably). This makes the process of development so much quicker.

Magnity’s picture

OK. I'll work through the points in turn, and hopefully won't miss anything:

#17:
1) Fixed via #663176: Field assigned_title doesn't get filled
2) (and #19) The criteria in #19 seems fairly logical, but a bit too restrictive in my opinion. For one, it'd need to be able to use the persons and teams from the host organization.
3) There is a problem with the list pages, in that everyone wants their own key fields to be on them, but I doubt that anyone would want all fields on it! For the D7 version, I am creating all of these pages through Views, and once this has been done will probably back port the views to D6. Then you can amend which fields are listed as much as you like...
4) (and #18). The assigned to field for projects will stay. I believe this field is fairly widely used.
5) I presume you'd want these permissions to do something as well as just be a checkbox on the user/perm page....! It would be a useful addition, but I doubt I will get this far at the moment unless I can steal some code from the dashboard project (haven't looked to see how @jurgenhaas has implemented it yet).

-PEOPLE- and -TEAMS- are simply separators so that you can see whether you're assigning to a person or a team. Perhaps i'll add some validation so that if those are selected a message appears explaining.

So I think the things to do will be the selection of who gets listed in the dropdown and the validation in case of selecting -PEOPLE-. Unfortunately I've run out of time tonight on this, so I'll try to have a look tomorrow.

As an aside though, I've fixed the styling on the node view.

jurgenhaas’s picture

@Magnity, let me comment on your item 2) in #23: I thought too, that all members of the hosting organization should be available for selection but then I thought why should there be a finegrained assignment on a lower level - the project - if we get those people from the organization anyway. That wouldn't make sense.

Therefore, my code provides a list with *all* members of the organization, if the assignment on the project level is not use (project unassigned). But in any other case, the assignment onm the lower level is more important and therefore overwrites that from the organization.

This would actually address scenarios where you work for an organization on several projects where people from that organization not necessarily know about all the projects in their own company.

Now, I've put that all in one function in storm_dashboard and I happily share that with you, if you wanted to. Please feel free to grab it and stick it into Storm and/or modify it to what ever you want to do with it.

Magnity’s picture

@jurgenhaas:

Would you be able to point to the particular place in your code that deals with the assignment please?

Also, if you're happy for the features you've coded to go into Storm, then it'd be great if you could submit patches for those bits.

jurgenhaas’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new7.37 KB

@maginity, please find attached the patch for the assignment options. It's a central function in storm.module which is called by the stormticket_form and stormtask_form respectively. I've tested it and it works apart from the organization or project being changed from within the form. If the rest of it is OK we can probably access that in a second step.

Magnity’s picture

Thanks, I'll test it out properly in due course. I am still wondering about the best options to display too though.

Just a quick question from reading through the code:

+++ storm.module	(working copy)
@@ -793,3 +793,126 @@
+  if (!$organization_nid) {
+    $options['all'] = t('- no filter -');
+    $options['mine'] = t('- mine -');
+  }

What does this bit do?

I'm on crack. Are you, too?

jurgenhaas’s picture

This whole function is used in two ways: (1) to create select options for the filters (which needs all teams and persons as well as the two options "all" and "mine") and (2) to create the select options to assign an existing task/ticket to someone (which doesn't need those two options).

Mode (1) works if you do not provide any $organization_nid and mode (2) otherwise. This is also partially described in the function comment above.

nicoloconte’s picture

@all, next step is to add a filter for "assigned to" to task and ticket. It may be also a good idea to add the possibility to send an email to the person that has been assigned to.

Here my code for the email function (in italian language :) but I can translate it):

// INSERT / UPDATE FUNCTIONS
  function stormticket_insert($node) {
    _stormticket_beforesave($node);
   
   $result = db_query("SELECT * FROM {stormperson} WHERE nid = %d ", $node->assigned_nid);
     if ($data = db_fetch_object($result)) {
        $emailTo = $data->email;
        $name = $data->fullname;
     } 
   
   $result = db_query("SELECT * FROM {url_alias} WHERE src = '%s' ", 'node/'.$node->nid);
     if ($data = db_fetch_object($result)) {
        $url = $data->dst;
     }
     
   //URL for the ticket page
   global $base_url;  
   $url_down = $base_url.'/'.$url;
     
   $result = db_query("SELECT * FROM {node} WHERE nid = %d", $node->nid);
     if ($data = db_fetch_object($result)) {
        $titolo = $data->title;
     }  
     
   //Parameters for the email
     $params = array(
        'name' => $name,
        'url' => $url_down,
        'titolo' => $titolo
      );
 
   //Send the email to '$emailTo' if send_email checkbox is selected
   if($node->send_mail == 'yes' && $emailTo != '') {
        drupal_mail('stormticket', 'assigned_to', $emailTo, language_default(), $params); 
  }
/**
  * Function to send the email
  */
 function stormticket_mail($key, &$message, $params) {
   switch ($key) {
     case 'assigned_to':
       $message['subject'] = t('Assegnamento ticket');
       $message['body'] = t('Ciao ').$params['name'].t('. Ti e\' stato appena assegnato il seguente ticket: ').$params['url']
                         .t(' dal titolo: "').$params['titolo'].t('"');
       break;
       
       case 'assigned_to_update':
       $message['subject'] = t('Aggiornamento ticket');
       $message['body'] = t('Ciao ').$params['name'].t('. Il ticket "').$params['titolo'].t('", a cui sei assegnato e\' stato appena modificato: ').$params['url'];
       break;
    }
  }

I hope that can help you...

Nicolo'

gnuwings’s picture

@magnity:
Thanks for fixing the bugs. I have tested it and it looks good. Since the basic features are working, I'm going to implement it on my production instance. This will surely give more feedback from the actual users.

@all:
I really liked to contribute code to drupal and storm module. However, I only have limited exposure to Drupal source code and hence didn't made an attempt. I'm still in the learning process but it's taking too much time due to other priorities. Your help and encouragement is driving me forward.

Magnity’s picture

Status: Needs review » Needs work

@jurgenhaas: A couple of errors applying the patch in #26:

(Stripping trailing CRs from patch.)
patching file storm.module
(Stripping trailing CRs from patch.)
patching file stormtask/stormtask.module
Hunk #1 FAILED at 655.
1 out of 1 hunk FAILED -- saving rejects to file stormtask/stormtask.module.rej
(Stripping trailing CRs from patch.)
patching file stormticket/stormticket.module
Hunk #1 FAILED at 533.
1 out of 1 hunk FAILED -- saving rejects to file stormticket/stormticket.module.rej

@nicoloconte: A good extension to get an email out, but would it be possible to post your code in diff format and to include a setting to control whether the emails are automatically sent out?

@gnuwings: Please remember that the 6.x-1.x-dev is as stated a development branch. I'd recommend that if you're using it on a production site that you upgrade to the next available official release when it comes out, or test -dev releases carefully before putting loading onto your production site.

Magnity’s picture

Correction: Patch in #26 does apply properly. I wasn't quite on the latest dev.

However, I think this does need to account for changes in the organization/project dropdowns before going in.

jurgenhaas’s picture

StatusFileSize
new10.86 KB

OK, here is the second part of the patch, please apply *in addition* to the first patch in #26. It reacts to organization and project select changes in the task and ticket add/edit form. There is one cosmetic todo outstanding but I wanted to provide this for your review first before watsing time on that last little piece.

Note: please flush your menu cache after applying this patch because there is a new menu entry to be recognized.

Magnity’s picture

StatusFileSize
new65.96 KB

Having applied both patches (#26 and #33), the options drop down is a bit odd...

Screenshot attached.

I wouldn't expect to see empty options, the identation doesn't seem consistent, and wasn't expecting to see -no filter- and -mine- on the add task box.

jurgenhaas’s picture

Status: Needs work » Needs review
StatusFileSize
new19.82 KB

Here is the improved version of the patch. You now only need to apply this one patch to the latest -dev and it now has also the proper optgroup structure in the drop-down.

Magnity’s picture

Status: Needs review » Needs work
StatusFileSize
new9.33 KB

Options dropdown still doesn't seem quite right... see screenshot.

The 0 / 4 seem to be eroneous.

jurgenhaas’s picture

Can you please help me debug this? When this happens, can you please look into the HTML source and see the values of the wrong select items? Those values should be node-ids of people but I don't know why it's using the numbers instead of their names.

The latest patch includes the modification that we use the $person->fullname if available and if that's empty, then we use $person->name

Are you probably having people with no fullname provided?

nicoloconte’s picture

@Magnity:
Add this piece of code into "function stormticket_form(&$node)" to control whether the emails are automatically sent out:

$options = array(
    'no' => ('No'),
    'yes' => ('Yes')
  );
  $form['group5']['send_mail'] = array(
    '#type' => 'select',
    '#title' => t('Send an email'),
    '#options' => $options,
    '#default_value' => $node->send_mail,
  );

I can't create a diff file because this extension was implemented into an old storm version.

The code that I posted is good also for project ad task!!

Another important step is to add a filter to choose the "assigned to" person.

Magnity’s picture

This seems to be the html for the dropdown:

<select id="edit-assigned-nid" class="form-select" name="assigned_nid">
<option value="none">- unassigned -</option>
<optgroup label="Teams:">
</optgroup>
<optgroup label="People:"/>
<optgroup label="4"/>
<optgroup label="0"/>
<option value="91">rallermann</option>
</select>

I think it could be that the 'fullname' field is blank. However, the person nodes do have titles, so I wonder if that could be used instead?

We could also try to 'design out' the dual name field on the person record. I don't see why we need both a 'name' and a 'fullname' fields. Perhaps that is a different issue.

#38: @nicoloconte: I'll split this into a separate issue and post something when I get a minute. Its probably best we keep this one on the main options issue.

Magnity’s picture

I've left the patch in operation on the demo site by the way, so @all can have a play around with it. That has the advantage of lots of example data of various levels of completeness...

jurgenhaas’s picture

This seems really strange and I double-checked the code, not knowning where this is coming from. The fact that your HTML is having 4 optgroups is what should be impossible.

The function storm_get_addignment_options delivers an array of the following structure:

$options = array(
  'none' => '- unassigned -',
  'Teams:' => array(
    '1' => 'name',
    '2' => 'name',
  ),
  'People:' => array(
    '3' => 'name',
    '4' => 'name',
  ),
);

and if there is no team or person, then the sub-arrays for teams or people get removed before returning the options-array.

Each sub-array generates an optgroup in the resulting html, so there can only be two, one or none. So I'm struggling how your html is getting 4 of them.

Is it possible that you check the Firebug-Console and see what the AJAX request is getting as an answer from the server when populating the select box with those values please?

Once we know that, we can determine whether the php code producing the array or the js code transforming that into html, is going wrong.

nicoloconte’s picture

StatusFileSize
new2.63 KB

@Magnity, can you create the new issue for the email extension?
I created by now a module that works with the new storm release! You can find it attached to this post, I'm weating for feedbacks.

Thanks a lot for your work!

dwork’s picture

I implemented stormmail.zip. First, I had to change the Italian to English, so you might consider keeping those phrases at the top of the module or in a database extension. Second, I had some trouble with drupal_mail (evidently I'm not alone). I wasn't able to debug it per se, but I installed the SMTP module using SLL and it works just fine now. Thanks for stormmail, this was needed.

It might be useful to allow the Email flag to default to Yes instead of No, and to allow the assignment to "stick" on the project/task/ticket. That is, if I select "Yes" on project "X", then any update to project "X" results in an email.

However, as for the rest of this thread, I must be thick. I have trouble following the threads of development interchange, multiple patches, the lack of a link to the development module, etc. I just installed storm-6.x-1.28.tar and it does NOT have the ability to assign a task or ticket to a person. I'm reluctant to install from the CVS repository due mostly to my inexperience with Drupal, but I'm also unclear as to whether the patches in this thread were applied on the test site, to the dev module, or what. Sorry.

The ability to assign tasks and tickets to individuals is mandatory for my company and an integral part of more robust ticketing systems such as RT.

jurgenhaas’s picture

@magnity, your problem creating tasks/tickets is most probably related to #663164: stormproject is an undefined function

Magnity’s picture

@all:
All conversions re the email notifications functionality should go into #637852: Email notification..

@jurgenhaas:
Re #41: Will have a look when I get a minute.
Re #44: Which problem was this?

jurgenhaas’s picture

@magnity:
The problem in the third para of #43.

Magnity’s picture

@jurgenhaas: Still confused as to what #663164: stormproject is an undefined function has to do with this one.

Magnity’s picture

@jurgenhaas:
Re #41:

It looks like it is due to the fullname being blank.

This is the JS response:
{ "none": "- unassigned -", "Teams:": { "5": "Example Team" }, "People:": { "4": null, "0": null, "91": "rallermann" } }

+++ storm.module	(working copy)
@@ -793,3 +793,151 @@
+      while ($person = db_fetch_object($result)) {
+        $options[$people][$person->nid] = ($person->fullname) ? $person->fullname : $person->name;
+      }

Doesn't $person->name need to be set somewhere? (Forgive me if I've overlooked this). It doesn't seem to be in the SQL query. The name is simply the node title, so perhaps we should add n.title to the select and use that?

This review is powered by Dreditor.

jurgenhaas’s picture

@maginity: regarding #47, I was under the impression that you had a problem with Storm as you were saying "...I just installed storm-6.x-1.28.tar and it does NOT have the ability to assign a task or ticket to a person. I'm reluctant to install from the CVS repository due mostly to my inexperience with Drupal, but I'm also unclear as to whether the patches in this thread were applied on the test site, to the dev module, or what. ..." and I thought that #663164: stormproject is an undefined function would be a hint - however, I might have misinterpreted your post.

jurgenhaas’s picture

StatusFileSize
new20 KB

Attached is another complete patch against the .dev release from this morning. It solves the problem with the null values and also does an additional sanity check, just in case, title was empty too.

Magnity’s picture

@jurgenaas:
Re #49: I see - we're talking at cross-purposes on this. I didn't write the original comment in #43.

To clarify for all:
- 6.x-1.28 contains none of this functionality
- 6.x-1.x-dev contains the basic assignment but not with these patches
- Test site runs 6.x-1.x-dev with the patch _options_3 (currently)

Will test in due course.

jurgenhaas’s picture

@magnity, I'm sorry. I didn't recognize the error in #43.

Your clarification in #51 is OK.

What you should do for furethr testing: use the Storm dev-release from December 31st and the storm_assignment_options_4.patch from #50.

Magnity’s picture

OK:
- 6.x-1.28 contains none of this functionality
- 6.x-1.x-dev contains the basic assignment but not with these patches
- Test site now runs 6.x-1.x-dev with the patch _options_4

I'm still getting a zero as per the attached screenshot.

Its a bit odd that it is a zero too - as there can't be a nid for a person of zero.

jurgenhaas’s picture

StatusFileSize
new20.15 KB

Not sure where this is coming from and it can't be analyzed without having access to the data in the background. Maybe a team with team member zero?

Anyway, I've included another sanity check and remove records with a zero id before delivering it back to the browser.

Magnity’s picture

Status: Needs work » Reviewed & tested by the community

The problem was caused by a bug in the saving of teams. A zero:Null entry was always added to the members array. I've opened an issue for this at #671588: Team members array always has 0:Null appended.

With the alteration below, I think this is ready to be committed. I'll leave it at RTBC for a day or so in case people who've subscribed to this issue wish to test.

+++ storm.module	(working copy)
@@ -793,3 +793,161 @@
+  if (isset($options[$people][0])) {
+    unset($options[$people][0]);
+  }
+  if (isset($options[$teams][0])) {
+    unset($options[$teams][0]);
+  }

Because the entry (if it exists) has a value Null, these don't currently pick up the problem.

I replaced isset($options[$people][0]) with array_key_exists(0, $options[$people]) and this worked. Similarly for the teams lines.

I'm on crack. Are you, too?

jurgenhaas’s picture

Excellent news. Thanks @magnity for sorting this whole thing out.

Magnity’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Patch in #54 with modifications from #55 committed to DRUPAL-6--1.

Thanks to all for your efforts on this issue, especaially @jurgenhaas for the work on this patch.

Marking as patch needs porting as the functionality needs to go into the Drupal 7 branch.

@all: Please could you upgrade to the latest dev (rolls at midnight), as I plan to release 6.x-1.29 in a few days with this codebase.

gnuwings’s picture

@Magnity
Have you got time to port the view stuff(item #3 in comment #23) into D6? I am trying to understand how views works in D6. I will surely test the latest dev later tonight.

Magnity’s picture

@gnuwings:

The views integration that I mentioned in #23 is effectively a complete rewrite of the way that lists are displayed in Storm. It is not complete for the D7 version yet. Therefore, I will not put this into the D6 version until it is complete in the D7 verson.

You can override any of the Storm lists yourself in views however. Create a view via the Views UI, and then create a small module using hook_menu_alter to remove the existing menu callback for the Storm list and set the view path to that. Views is worth playing around with, as it is very powerful and simple once you get the hang of it.

Magnity’s picture

Status: Patch (to be ported) » Fixed

Committed this code to D7 (although it will probably be reworked as the port progresses to fit in with Fields API etc)

Also changed the structure of the projects dropdown a little to use the options groups etc.

I think that makes this issue fixed. Thanks all for the input.

jurgenhaas’s picture

Good work and collaboration on this, thanks @magnity.

gnuwings’s picture

I have installed the latest stable version of storm module, but when I create or edit task, the following warning occurs:

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/gnuwings/public_html/dev/qcsc/drupal/sites/dev.gnuwings.org/modules/storm/storm.module on line 943.

This warning occurs only if there are no teams configured in storm. I have tried to fix it in the source, but my inexperience in the code made it ugly and I'm not sure whether it's the ideal solution. Can somebody look into this?

I would like to appreciate @Magnity and @jurgenhaas for the addition of wonderful features in storm.

Magnity’s picture

Now that the feature is in, any bugs should go into separate issues.

I've created a new issue for this: #678250: Warning on create/edit task.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

francewhoa’s picture

I'm not a coder. Would that patch add the following new feature?
http://drupal.org/node/738842#comment-2702710