Users are able to 'Add case' before a project is created, the 'Add case' button should possibly only be available once a project has been created?

Comments

realityloop’s picture

It's also not possible to edit the case and assign it to a project after adding a project to the group.

Grayside’s picture

This should probably be handled in the Casetracker module itself, as it affects any site using Casetracker, not just OA. Something like this might do the trick:

function casetracker_form_alter(&$form, &$form_state, $form_id) {
  if ($form['#id'] == 'node-form' && casetracker_is_case($form['#node']->type)) {
    //
    // @todo Execute view for project options
    //
    foreach ($results = db_fetch_object($results)) {
      return;
    }
    drupal_set_message(t('You must create a project before you can create a case.'));
    drupal_goto('node/add/project', 'destination=' . $_GET['q']);
  }
}
realityloop’s picture

issue added to Casetracker module http://drupal.org/node/912854

mpotter’s picture

Version: » 6.x-1.2

Closing old D6 issues.

mpotter’s picture

Status: Active » Closed (won't fix)