function casetracker_block_jump_to_case_number_submit in Case Tracker 6
Same name and namespace in other branches
- 5 casetracker.module \casetracker_block_jump_to_case_number_submit()
- 7 casetracker.module \casetracker_block_jump_to_case_number_submit()
Submit function for our "Jump to case number" block.
File
- ./
casetracker.module, line 513 - Enables the handling of projects and their cases.
Code
function casetracker_block_jump_to_case_number_submit($form, $form_state) {
list($pid, $nid) = explode('-', $form_state['values']['case_number']);
$case_nid = db_result(db_query("SELECT nid FROM {casetracker_case} WHERE pid = %d AND nid = %d", $pid, $nid));
if (!$case_nid) {
drupal_set_message(t('Your case number was not found.'), 'error');
return;
}
drupal_goto('node/' . $case_nid);
}