Many of my users will add comments rather than tickets to tasks. I would like to get them using the ticket system instead. I'm trying to add a "Create Ticket" link near the Add Comment link on the Task node view. I've updated template.php with a div and anchor tag added to the suffix.
function garland_stormtask_view($node, $teaser = FALSE, $page = FALSE) {
$node = node_prepare($node, $teaser);
$w = 0;
$node->content['stormtask'] = array(
'#prefix' => '<div id="stormtask">',
'#suffix' => '</div><div align="right"><a href="/node/add/stormticket?destination=node/">Create a Ticket</a></div>',
'#weight' => $w++,
);
$node->content['stormtask']['field'] = array(
'#type' => 'fieldset',
'#collapsible' => true,
'#title' => 'Details',
'#weight' => $w++,
);
$node->content['stormtask']['field']['organization'] = array(
'#prefix' => '<div class="organization">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', storm_t('Organization', 'task'), l($node->organization_title, 'node/'. $node->organization_nid)),
'#weight' => $w++,
);
$node->content['stormtask']['field']['project'] = array(
'#prefix' => '<div class="project">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', storm_t('Project', 'task'), l($node->project_title, 'node/'. $node->project_nid)),
'#weight' => $w++,
);
$node->content['stormtask']['field']['stepno'] = array(
'#prefix' => '<div class="stepno">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', storm_t('Step no.', 'task'), $node->stepno),
'#weight' => $w++,
);
$node->content['stormtask']['field']['category'] = array(
'#prefix' => '<div class="category">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', t('Category'), storm_icon('category_'. $node->taskcategory, $node->taskcategory)),
'#weight' => $w++,
);
$node->content['stormtask']['field']['status'] = array(
'#prefix' => '<div class="storm_status">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', t('Status'), storm_icon('status_'. $node->taskstatus, $node->taskstatus)),
'#weight' => $w++,
);
$node->content['stormtask']['field']['priority'] = array(
'#prefix' => '<div class="priority">',
'#suffix' => '</div>',
'#value' => theme('storm_view_item', t('Priority'), storm_icon('priority_'. $node->taskpriority, $node->taskpriority)),
'#weight' => $w++,
);
return $node;
I'd like the "Create Ticket" link to have fields like project, organization and task filled in according to the project, organization and task I was on. I'm not exactly sure how to do this.. Anyone have any idea?
Comments
Comment #1
jorditr commentedI also would like to know it. I published some ideas to use one project as help desk area on #330391: Support Area for Storm module contribution but I postponed it just because I realized that I was not passing those parameters. I had no more time to research on it.
Comment #2
Magnity commentedI think the way that it would be best done is to add a "Tickets" icon on the right hand side, similar to when you view a project. I don't want to add anything to the node links area as this would be inconsistant with other areas of Storm.
However, remember that you can turn off comments for a particular type of node, and this may be most effective.
Comment #3
Magnity commentedCommitted change which adds links to the RHS of the task node view, also which makes the links more similar to the Storm Dashboard.
http://drupal.org/cvs?commit=228024
http://drupal.org/cvs?commit=228032