You are here

function _webform_fetch_draft_sid in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.module \_webform_fetch_draft_sid()
  2. 7.3 webform.module \_webform_fetch_draft_sid()

Check if current user has a draft of this webform, and return the sid.

1 call to _webform_fetch_draft_sid()
webform_node_view in ./webform.module
Implements hook_node_view().

File

./webform.module, line 2724

Code

function _webform_fetch_draft_sid($nid, $uid) {
  $result = db_query("SELECT * FROM {webform_submissions} WHERE nid = %d AND uid = %d AND is_draft = 1 ORDER BY submitted DESC", $nid, $uid);
  $row = db_fetch_array($result);
  if (isset($row['sid'])) {
    return (int) $row['sid'];
  }
  return FALSE;
}