// requires activation if (isset($_GET['confirm']) && isset($_GET['user_id']) && $_GET['confirm'] == 1) { // confirmed - change the status and notify the owner now if (activateCache($_GET['cacheid'])) { assignUserToCase($usr['userid'], $_GET['cacheid']); notifyOwner($_GET['cacheid'], 0); lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $_GET['user_id'], true, lib\Objects\User\AdminNote::CACHE_PASS, $_GET['cacheid']); $confirm = "<p> " . tr("viewPending_09") . ".</p>"; } else { $confirm = "<p> " . tr("viewPending_10") . ".</p>"; } } else { if (isset($_GET['confirm']) && isset($_GET['user_id']) && $_GET['confirm'] == 2) { // declined - change status to archived and notify the owner now if (declineCache($_GET['cacheid'])) { assignUserToCase($usr['userid'], $_GET['cacheid']); notifyOwner($_GET['cacheid'], 1); lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $_GET['user_id'], true, lib\Objects\User\AdminNote::CACHE_BLOCKED, $_GET['cacheid']); $confirm = "<p> " . tr("viewPending_11") . ".</p>"; } else { $confirm = "<p> " . tr("viewPending_12") . ".</p>"; } } else { if ($_GET['action'] == 1 && isset($_GET['user_id'])) { // require confirmation $confirm = "<p> " . tr("viewPending_13") . " \"<a href='viewcache.php?cacheid=" . $_GET['cacheid'] . "'>" . getCachename($_GET['cacheid']) . "</a>\" " . tr("viewPending_14") . " " . getCacheOwnername($_GET['cacheid']) . ". " . tr("viewPending_15") . ".</p>"; $confirm .= "<p><a href='viewpendings.php?user_id=" . $_GET['user_id'] . "&cacheid=" . $_GET['cacheid'] . "&confirm=1'>" . tr("viewPending_16") . "</a> |\n <a href='viewpendings.php'>" . tr("viewPending_17") . "</a></p>"; } else { if ($_GET['action'] == 2 && isset($_GET['user_id'])) { // require confirmation $confirm = "<p> " . tr("viewPending_18") . " \"<a href='viewcache.php?cacheid=" . $_GET['cacheid'] . "'>" . getCachename($_GET['cacheid']) . "</a>\" " . tr("viewPending_14") . " " . getCacheOwnername($_GET['cacheid']) . ". " . tr("viewPending_19") . ".</p>";
function updateCase($caseID, $buildID, $testProject, $testProjectID, $testplanID, $autoSuiteID, $execStatus, $testerID, $keywordID) { // get necessary case parameters $caseInfo = getCaseInfo($caseID); $category = $caseInfo[0]; $component = $caseInfo[1]; $caseName = $caseInfo[2]; // get case ID, if exists $caseID = getCaseIDfromName($caseName); // if no case found, must create it if ($caseID == "NOT_FOUND") { // create Category suite $catSuiteID = createCategorySuite($category, $autoSuiteID); if ($catSuiteID == "NOT_FOUND") { return "ERROR: Can't get suiteID for category '" . $category . "' or Cannot create it!"; } // create Component suite $compSuiteID = createComponentSuite($component, $catSuiteID); if ($compSuiteID == "NOT_FOUND") { return "ERROR: Can't get suiteID for component '" . $component . "' or Cannot create it!"; } // create new case entry $caseID = createNewCase($caseName, $compSuiteID); if ($caseID == "NOT_FOUND") { return "ERROR CASE: New Case entry for '" . $caseName . "' was NOT created in nodes_hierarchy table!"; } // create new version entry $versionID = createNewCaseVersion($caseID); if ($versionID == "NOT_FOUND") { return "ERROR CASE: New Case Version entry for caseID='" . $caseID . "' was NOT created in nodes_hierarchy table!"; } // create new version for case $versionID = createNewVersionEntry($versionID, $testerID); if ($versionID == "NOT_FOUND") { return "ERROR CASE: New Case Version entry for versionID='" . $versionID . "' was NOT created in tcversions table!"; } // create Plan to tcversion mapping $ID = createPlanToVersionEntry($versionID, $testplanID); if ($ID == "NOT_FOUND") { return "ERROR CASE: New Case Version to TestPlan mapping for versionID='" . $versionID . "' was NOT created in testplans_tcversions table!"; } // case found, get versionID } else { // get all versions for this caseID $versionIDsArr = getAllVersionIDs($caseID); if ($versionIDsArr == "NOT_FOUND") { return "ERROR CASE: No Case Versions Array found for caseID='" . $caseID . "' in nodes_hierarchy table!"; } // get versionID for the provided testplan $versionID = getVersionID($versionIDsArr, $testplanID); if ($versionID == "NOT_FOUND") { return "ERROR CASE: No Case VersionID found for caseID='" . $caseID . "' in testplan_tcversions table!"; } // get external caseID (featureID) $ID = getExternalCaseID($versionID); if ($ID == "NOT_FOUND") { return "ERROR CASE: No Case External ID found for caseID='" . $caseID . "' in testplan_tcversions table!"; } } // assign case to Automate keyword $keywordID = assignKeyword($caseID, $keywordID); if ($keywordID == "NOT_FOUND") { return "ERROR CASE: No Keyword Assignment was made for caseID='" . $caseID . "' in testcase_keywords table!"; } // assign executor to case version $assignID = assignUserToCase($versionID, $ID, $testerID); if ($assignID == "NOT_FOUND") { return "ERROR CASE: No User to Case Assignment was made for VersionID='" . $versionID . "' in user_assignments table!\n" . $assignID; } // create new execution entry $executionID = createNewExecution($buildID, $execStatus, $testplanID, $versionID, $testerID); if ($executionID == "NOT_FOUND") { return "ERROR CASE: No Execution Entry created for versionID='" . $versionID . "' in executions table!"; } // create execution extry in cfiled table $cfieldID = createCfieldExecution($executionID, $testplanID, $versionID); return $cfieldID == "NOT_FOUND" ? "ERROR CASE: No Case Execution Entry created for versionID='" . $versionID . "' in cfield_execution_values table!" : "Execution successfully UPDATED for case versionID='" . $versionID . "'"; }