當前位置: 首頁>>代碼示例>>PHP>>正文


PHP testplan::getNumberOfBuilds方法代碼示例

本文整理匯總了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;
    }
}
開發者ID:tamtrong,項目名稱:testlink,代碼行數:34,代碼來源:frmWorkArea.php

示例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;
    }
}
開發者ID:moraesmv,項目名稱:testlink-code,代碼行數:31,代碼來源:frmWorkArea.php


注:本文中的testplan::getNumberOfBuilds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。