コード例 #1
0
ファイル: linkto.php プロジェクト: moraesmv/testlink-code
     $op['status_ok'] = isset($_GET[$key]);
     if (!$op['status_ok']) {
         $op['msg'] = lang_get($labelID);
         break;
     }
 }
 $anchor = isset($_GET['anchor']) ? $_GET['anchor'] : null;
 $version = isset($_GET['version']) ? $_GET['version'] : null;
 $tprojectPrefix = isset($_GET['tprojectPrefix']) ? $_GET['tprojectPrefix'] : null;
 $item = isset($_GET['item']) ? $_GET['item'] : null;
 $id = isset($_GET['id']) ? $_GET['id'] : null;
 if ($op['status_ok']) {
     $tproject = new testproject($db);
     $tproject_data = $tproject->get_by_prefix($tprojectPrefix);
     if ($op['status_ok'] = !is_null($tproject_data)) {
         $tproject->setCurrentProject($tproject_data['id']);
         $op['status_ok'] = isset($itemCode[$item]);
         $op['msg'] = sprintf(lang_get('invalid_item'), $item);
     } else {
         $op['msg'] = sprintf(lang_get('testproject_not_found'), $tprojectPrefix);
     }
 }
 if ($op['status_ok']) {
     // Build  name of function to call for doing the job.
     $pfn = 'process_' . $item;
     $jump_to = $pfn($db, $id, $tproject_data['id'], $tprojectPrefix, $version);
     $op['status_ok'] = !is_null($jump_to['url']);
     $op['msg'] = $jump_to['msg'];
 }
 if ($op['status_ok']) {
     // add anchor to URL