/**
 * @author Lennard Bredenkamp, BFE
 * test, whether new relation is a duplicate of an already existing TTTs relation. 
 * If relation already exists, tts_relationship_add will then trigger "Duplicate" Error
 * @return false if no duplicate is found, true if duplicate is found
 */
function tts_relation_isDuplicate($tproject_id, $exec_id, $bug_id)
{
    $relations = loadRelations($bug_id);
    // var_dump( $relations );
    $twin = false;
    if ($relations != null) {
        foreach ($relations as $relation) {
            // echo "<br>relation->tts_exec_id: $relation->tts_exec_id, f_tts_exec_id: $f_tts_exec_id, relation->tts_tproject_id: $relation->tts_tproject_id, f_tts_tproject_id: $f_tts_tproject_id <br>";
            if ($relation->tts_exec_id == $exec_id && $relation->tts_tproject_id == $tproject_id) {
                $twin = true;
                return $twin;
                // abort search if one duplicate is found
            }
        }
    }
    return $twin;
}
 /**
  * @author Lennard Bredenkamp, BFE
  * displays tts relationships box in bug view page
  */
 function tts_relations_view($p_event, $p_bug_id)
 {
     $relations = loadRelations($p_bug_id);
     //loadRelations in file tts_relations_box_inc.php
     tts_relation_list_box($relations, $p_bug_id);
 }