Esempio n. 1
0
/**
 * @return object returns the arguments for the page
 */
function init_args()
{
    //the id (attachments.id) of the attachment to be downloaded
    $iParams = array("id" => array(tlInputParameter::INT_N), 'skipCheck' => array(tlInputParameter::INT_N));
    $args = new stdClass();
    G_PARAMS($iParams, $args);
    return $args;
}
Esempio n. 2
0
function init_args()
{
    $iParams = array("reqURI" => array(tlInputParameter::STRING_N, 0, 4000));
    $pParams = G_PARAMS($iParams);
    $args = new stdClass();
    $args->reqURI = $pParams["reqURI"] != '' ? $pParams["reqURI"] : 'lib/general/mainPage.php';
    return $args;
}
/**
 * @return object returns the arguments for the page
 */
function init_args()
{
    //the id (attachments.id) of the attachment to be downloaded
    $iParams = array("id" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    G_PARAMS($iParams, $args);
    $_REQUEST = strings_stripSlashes($_REQUEST);
    return $args;
}
Esempio n. 4
0
/**
 * init_args
 *
 * Collect all inputs (arguments) to page, that can be arrived via $_REQUEST,$_SESSION
 * and creates an stdClass() object where each property is result of mapping page inputs.
 * We have created some sort of 'namespace', thi way we can easy understand which variables
 * has been created for local use, and which have arrived on call.
 *
 */
function init_args()
{
    $iParams = array("tplan_id" => array(tlInputParameter::INT_N), "format" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
    $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : '';
    return $args;
}
/**
 * @return object returns the arguments for the page
 */
function init_args()
{
    //the id (attachments.id) of the attachment to be deleted
    $iParams = array("id" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    G_PARAMS($iParams, $args);
    // take care of proper escaping when magic_quotes_gpc is enabled
    $_REQUEST = strings_stripSlashes($_REQUEST);
    return $args;
}
Esempio n. 6
0
function init_args()
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $args = new stdClass();
    $iParams = array("reqURI" => array(tlInputParameter::STRING_N, 0, 4000));
    $pParams = G_PARAMS($iParams);
    $args->reqURI = $pParams["reqURI"] != '' ? $pParams["reqURI"] : 'lib/general/mainPage.php';
    $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
    $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
    return $args;
}
/**
 *
 *
 */
function initEnv()
{
    $iParams = array("reqURI" => array(tlInputParameter::STRING_N, 0, 4000));
    $pParams = G_PARAMS($iParams);
    $args = new stdClass();
    $args->reqURI = $pParams["reqURI"] != '' ? $pParams["reqURI"] : 'lib/general/mainPage.php';
    $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
    $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
    $gui = new stdClass();
    $gui->title = lang_get('main_page_title');
    $gui->titleframe = "lib/general/navBar.php?tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . "&updateMainPage=1";
    $gui->mainframe = $args->reqURI;
    return array($args, $gui);
}
 * @package 	TestLink
 * @author 		Erik Eloff
 * @copyright 	2010, TestLink community
 * @version    	CVS: $Id: checkTCaseDuplicateName.php,v 1.3 2010/10/10 13:41:13 franciscom Exp $
 *
 * @internal Revisions:
 * 20101010 - franciscom - added testsuite_id as parameter, needed to do checks when creating test case
 * 20100225 - eloff - initial commit
 *
 **/
require_once '../../config.inc.php';
require_once 'common.php';
testlinkInitPage($db);
$data = array('success' => true, 'message' => '');
$iParams = array("name" => array(tlInputParameter::STRING_N, 0, 100), "testcase_id" => array(tlInputParameter::INT), "testsuite_id" => array(tlInputParameter::INT));
$args = G_PARAMS($iParams);
if (has_rights($db, 'mgt_view_tc')) {
    $tree_manager = new tree($db);
    $node_types_descr_id = $tree_manager->get_available_node_types();
    // To allow name check when creating a NEW test case => we do not have test case id
    $args['testcase_id'] = $args['testcase_id'] > 0 ? $args['testcase_id'] : null;
    $args['testsuite_id'] = $args['testsuite_id'] > 0 ? $args['testsuite_id'] : null;
    // for debug -
    // $xx = "\$args['testcase_id']:{$args['testcase_id']} - \$args['name']:{$args['name']}" .
    //       " - \$args['testsuite_id']:{$args['testsuite_id']}";
    // file_put_contents('c:\checkTCaseDuplicateName.php.ajax', $xx);
    $check = $tree_manager->nodeNameExists($args['name'], $node_types_descr_id['testcase'], $args['testcase_id'], $args['testsuite_id']);
    $data['success'] = !$check['status'];
    $data['message'] = $check['msg'];
} else {
    tLog('User has not right needed to do requested action - checkTCaseDuplicateName.php', 'ERROR');
Esempio n. 9
0
function init_args()
{
    $iParams = array("testproject" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    $args->user = $_SESSION['currentUser'];
    return $args;
}
Esempio n. 10
0
function init_args()
{
    $iParams = array("tplan_id" => array(tlInputParameter::INT_N), "format" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    $args->tproject_id = $_SESSION['testprojectID'];
    if (is_null($args->format)) {
        tlog("Parameter 'format' is not defined", 'ERROR');
        exit;
    }
    return $args;
}
/**
 * @return object returns the arguments for the page
 */
function init_args(&$dbHandler)
{
    // id (attachments.id) of the attachment to be downloaded
    $iParams = array('id' => array(tlInputParameter::INT_N), 'apikey' => array(tlInputParameter::STRING_N, 64), 'skipCheck' => array(tlInputParameter::INT_N));
    $args = new stdClass();
    G_PARAMS($iParams, $args);
    $args->light = 'green';
    $args->opmode = 'GUI';
    // using apikey lenght to understand apikey type
    // 32 => user api key
    // other => test project or test plan
    $args->apikey = trim($args->apikey);
    $apikeyLenght = strlen($args->apikey);
    if ($apikeyLenght > 0) {
        $args->opmode = 'API';
        $args->skipCheck = true;
    }
    return $args;
}
Esempio n. 12
0
function init_args()
{
    $iParams = array("testproject" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    return $args;
}
Esempio n. 13
0
function init_args()
{
    $iParams = array("feature" => array(tlInputParameter::STRING_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    return $args;
}