--- old/userpoints/userpoints_workflow_ng.module	2008-01-05 18:41:45.000000000 +0100
+++ userpoints/userpoints_workflow_ng.module	2008-08-07 20:23:38.000000000 +0200
@@ -28,8 +28,13 @@ function userpoints_action_info() {
  * Implementation of a worklfow-ng action:  grant points to a user
  */
 function userpoints_action_grant_points($user, $settings, &$arguments, &$log) {
-  extract( workflow_ng_token_replace_all(array('number'), $settings, $arguments, $log) );
-  userpoints_userpointsapi(array('uid' => $user->uid, 'points' => $number));
+  extract( workflow_ng_token_replace_all(array('number', 'tid'), $settings, $arguments, $log) );
+  $params['uid'] = $user->uid;
+  $params['points'] = $number;
+  if ($tid) {
+    $params['tid'] = $tid;
+  }
+  userpoints_userpointsapi($params);
 }
 
 /**
@@ -42,10 +47,20 @@ function userpoints_action_grant_points_
     '#title' => t('Number of points'),
     '#default_value' => isset($settings['number']) ? $settings['number'] : '',
   );
+  // you can only set the category if the admin has enabled taxonomy
+  // otherwise it will be ignored
+  if (module_exists('taxonomy')) {
+    $form['tid'] = array(
+      '#type' => 'select',
+      '#title' => t('Category of points'),
+      '#options' => userpoints_get_categories(),
+      '#default_value' => isset($settings['tid']) ? $settings['tid'] :      variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL),
+    );
+  }
   workflow_ng_token_replacement_help($form, $argument_info);
   return $form;
 }
 
 function userpoints_action_grant_points_submit($form_id, $form_values) {
-  return workflow_ng_token_get_settings(array('number'), $form_values);
+  return workflow_ng_token_get_settings(array('number', 'tid'), $form_values);
 }
