You are here

function userpoints_confirm_approve_submit in User Points 6

Same name and namespace in other branches
  1. 5.3 userpoints.module \userpoints_confirm_approve_submit()
  2. 5.2 userpoints.module \userpoints_confirm_approve_submit()
  3. 7.2 userpoints.admin.inc \userpoints_confirm_approve_submit()
  4. 7 userpoints.admin.inc \userpoints_confirm_approve_submit()

File

./userpoints.module, line 1072

Code

function userpoints_confirm_approve_submit($form, &$form_state) {
  global $user;
  switch ($form_state['values']['operation']) {
    case 'approve':
      $status = USERPOINTS_TXN_STATUS_APPROVED;
      break;
    case 'decline':
      $status = USERPOINTS_TXN_STATUS_DECLINED;
      break;
    default:
      return FALSE;
  }
  $params = array(
    'txn_id' => $form_state['values']['txn_id'],
    'approver_uid' => $user->uid,
    'status' => $status,
  );
  userpoints_userpointsapi($params);
  $form_state['redirect'] = 'admin/user/userpoints/moderate';
}