本文整理汇总了PHP中testplan::getNumberOfBuilds方法的典型用法代码示例。如果您正苦于以下问题:PHP testplan::getNumberOfBuilds方法的具体用法?PHP testplan::getNumberOfBuilds怎么用?PHP testplan::getNumberOfBuilds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testplan
的用法示例。
在下文中一共展示了testplan::getNumberOfBuilds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateBuildAvailability
/**
* validate that some build exists (for Test Plan related features).
* If no valid build is found give feedback to user and exit.
*
* @author Martin Havlat
* 20060809 - franciscom - check if user can create builds,
* then put a link on the message page
* to create link feature
*
**/
function validateBuildAvailability(&$db, $tpID, $tpName, $prodName)
{
$tp = new testplan($db);
if (!$tp->getNumberOfBuilds($tpID)) {
$message = '<p>' . lang_get('no_build_warning_part1') . "<b> " . htmlspecialchars($tpName) . "</b>";
$link_to_op = '';
$hint_text = '';
if (has_rights($db, "testplan_create_build") == 'yes') {
// final url will be composed adding to $basehref
// (one TL variable available on smarty templates) to $link_to_op
$link_to_op = "lib/plan/buildEdit.php?do_action=create";
$hint_text = lang_get('create_a_build');
} else {
$message .= '</p><p>' . lang_get('no_build_warning_part2') . '</p>';
}
// show info and exit
$smarty = new TLSmarty();
$smarty->assign('content', $message);
$smarty->assign('link_to_op', $link_to_op);
$smarty->assign('hint_text', $hint_text);
$smarty->display('workAreaSimple.tpl');
exit;
}
}
示例2: validateBuildAvailability
/**
* validate that some build exists (for Test Plan related features).
* If no valid build is found give feedback to user and exit.
*
* @author Martin Havlat
**/
function validateBuildAvailability(&$db, $tplanID, $tprojectID, $open)
{
$tplanMrg = new testplan($db);
if (!$tplanMrg->getNumberOfBuilds($tplanID, $open, $open)) {
$info = $tplanMrg->get_by_id($tplanID);
$gui = new stdClass();
$gui->link_to_op = "login.php";
$gui->content = '<p>' . lang_get('no_build_warning_part1') . "<b> " . htmlspecialchars($info['name']) . "</b>";
$gui->link_to_op = '';
$gui->hint_text = '';
if ($_SESSION['currentUser']->hasRight($db, "testplan_create_build", $tprojectID, $tplanID) == 'yes') {
// final url will be composed adding to $basehref
// (one TL variable available on smarty templates) to $link_to_op
$gui->link_to_op = "lib/plan/buildEdit.php?tproject_id={$tprojectID}&tplan_id={$tplanID}&do_action=create";
$gui->hint_text = lang_get('create_a_build');
} else {
$gui->content .= '</p><p>' . lang_get('no_build_warning_part2') . '</p>';
}
// show info and exit
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display('workAreaSimple.tpl');
exit;
}
}