You are here

function _casetracker_next_project_number in Case Tracker 5

Returns the next project number for use. We don't use Drupal sequences here because our projects increment by 100, not 1. We keep the latest value stored as a variable so we don't have to worry about deletions/reuse. We didn't want to clutter up the sequences table with per-project case counters, which would be required if we forced that namespacing.

1 call to _casetracker_next_project_number()
casetracker_nodeapi in ./casetracker.module
Implementation of hook_nodeapi().

File

./casetracker.module, line 1445
Enables the handling of projects and their cases.

Code

function _casetracker_next_project_number() {
  $project_number = variable_get('casetracker_current_project_number', 0) + 100;
  variable_set('casetracker_current_project_number', $project_number);
  return $project_number;
}