Location: PHPKode > projects > Druid Defect Control > defectcontrol_0.9.4/tts/transitions.php
<?php

/* __ Defines _____________________________________________________________ */

/* States types
 */
define ("ST_NEW", 0);
define ("ST_ASSIGNED", 1);
define ("ST_OPEN", 2);
define ("ST_RESOLVED", 3);
define ("ST_VERIFIED", 4);
define ("ST_DUPLICATED", 5);
define ("ST_POSTPONED", 6);

$tr_states = array(0 => 'New',
                   1 => 'Assigned',
                   2 => 'Open',
                   3 => 'Resolved',
                   4 => 'Verified',
                   5 => 'Duplicated',
                   6 => 'Postponed');

$tr_state_captions = array('New',
                          'Assign',
                          'Open',
                          'Resolve',
                          'Verify',
                          'Duplicate',
                          'Postpone');

$tr_state_actions = array('',
                          'assign.php',
                          'open.php',
                          'resolve.php',
                          'verify.php',
                          'duplicate.php',
                          'postpone.php');


/* __ Exported API ________________________________________________________ */

/* 
 * Returns: array of states needed to go from 'source'
 */
function tr_getStatesFor($source)
{

    switch($source) {
    case ST_NEW:
        return array(ST_ASSIGNED, ST_DUPLICATED, ST_POSTPONED);
    case ST_ASSIGNED:
        return array(ST_OPEN, ST_ASSIGNED, ST_DUPLICATED, ST_POSTPONED);
    case ST_OPEN:
        return array(ST_RESOLVED, ST_DUPLICATED, ST_POSTPONED);
    case ST_RESOLVED:
        return array(ST_ASSIGNED, ST_VERIFIED, ST_DUPLICATED, ST_POSTPONED);
    case ST_VERIFIED:
        return array(ST_DUPLICATED, ST_POSTPONED);        
    case ST_DUPLICATED:
        return array(ST_ASSIGNED);        
    case ST_POSTPONED:
        return array(ST_ASSIGNED);        
    default: 
        echo("Unknown state reached");
    }

}


?>
Return current item: Druid Defect Control