示例#1
0
        $op = doCreate($args, $build_mgr, $tplan_mgr, $date_format_cfg);
        $of->Value = $op->notes;
        $templateCfg->template = $op->template;
        break;
}
// BUGID 3716
$dummy = null;
$gui->release_date = isset($op->status_ok) && $op->status_ok && $args->release_date != "" ? localize_dateOrTimeStamp(null, $dummy, 'date_format', $args->release_date) : $args->release_date_original;
$gui->closed_on_date = $args->closed_on_date;
$gui->operation_descr = $op->operation_descr;
$gui->user_feedback = $op->user_feedback;
$gui->buttonCfg = $op->buttonCfg;
$gui->mgt_view_events = $_SESSION['currentUser']->hasRight($db, "mgt_view_events", $args->tproject_id, $args->tplan_id);
$gui->editorType = $editorCfg['type'];
$smarty = new TLSmarty();
renderGui($smarty, $args, $tplan_mgr, $templateCfg, $of, $gui);
/*
 * INITialize page ARGuments, using the $_REQUEST and $_SESSION
 * super-global hashes.
 * Important: changes in HTML input elements on the Smarty template
 *            must be reflected here.
 *
 *
 * @parameter hash request_hash the $_REQUEST
 * @parameter hash session_hash the $_SESSION
 * @return    object with html values tranformed and other
 *                   generated variables.
 * @internal revisions:
 *   20100707 - asimon - BUGID 3406 - added source_build_id and copy_tester_assignments
*/
function init_args($request_hash, &$treeMgr, $date_format)
示例#2
0
    case "doDelete":
    case "createStep":
    case "editStep":
    case "doCreateStep":
    case "doCopyStep":
    case "doUpdateStep":
    case "doDeleteStep":
    case "doReorderSteps":
    case "doInsertStep":
        $op = $commandMgr->{$pfn}($args, $_REQUEST);
        $edit_steps = true;
        $doRender = true;
        break;
}
if ($doRender) {
    renderGui($args, $gui, $op, $commandMgr->getTemplateCfg(), $cfg, $edit_steps);
    exit;
}
if ($args->delete_tc_version) {
    $status_quo_map = $tcase_mgr->get_versions_status_quo($args->tcase_id);
    $exec_status_quo = $tcase_mgr->get_exec_status($args->tcase_id);
    $gui->delete_mode = 'single';
    // Delete single Test Case version did not work
    // We do not need to check here if test case version has already been
    // execute because "Delete this version" button is hidden in this case
    $gui->delete_enabled = 1;
    $msg = '';
    $sq = null;
    if (!is_null($exec_status_quo)) {
        if (isset($exec_status_quo[$args->tcversion_id])) {
            $sq = array($args->tcversion_id => $exec_status_quo[$args->tcversion_id]);
示例#3
0
        break;
}
$gui->op->operation = $actionOperation[$args->doAction];
$roles = tlRole::getAll($db, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM);
unset($roles[TL_ROLES_UNDEFINED]);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('highlight', $highlight);
$smarty->assign('operation', $gui->op->operation);
$smarty->assign('user_feedback', $gui->op->user_feedback);
$smarty->assign('external_password_mgmt', tlUser::isPasswordMgtExternal($user->authentication));
$smarty->assign('mgt_view_events', $_SESSION['currentUser']->hasRight($db, "mgt_view_events"));
$smarty->assign('grants', getGrantsForUserMgmt($db, $_SESSION['currentUser']));
$smarty->assign('optRights', $roles);
$smarty->assign('userData', $user);
renderGui($smarty, $args, $templateCfg);
/**
 * 
 *
 */
function init_args()
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $iParams = array("delete" => array(tlInputParameter::INT_N), "user" => array(tlInputParameter::INT_N), "user_id" => array(tlInputParameter::INT_N), "rights_id" => array(tlInputParameter::INT_N), "doAction" => array(tlInputParameter::STRING_N, 0, 30), "firstName" => array(tlInputParameter::STRING_N, 0, 30), "lastName" => array(tlInputParameter::STRING_N, 0, 100), "emailAddress" => array(tlInputParameter::STRING_N, 0, 100), "locale" => array(tlInputParameter::STRING_N, 0, 10), "login" => array(tlInputParameter::STRING_N, 0, 30), "password" => array(tlInputParameter::STRING_N, 0, 32), "authentication" => array(tlInputParameter::STRING_N, 0, 10), "user_is_active" => array(tlInputParameter::CB_BOOL));
    $args = new stdClass();
    R_PARAMS($iParams, $args);
    return $args;
}
/*
  function: doCreate
    }
}
$gui->show_possible_values = 0;
if (isset($gui->cfield['type'])) {
    $gui->show_possible_values = $cfieldCfg->possible_values_cfg[$gui->cfield['type']];
}
// enable on 'execution' implies show on 'execution' then has nosense to display show_on combo
if ($args->do_action == 'edit' && $gui->cfield['enable_on_execution']) {
    $cfieldCfg->cf_show_on['execution']['style'] = ' style="display:none;" ';
}
$gui->cfieldCfg = $cfieldCfg;
$smarty = new TLSmarty();
$smarty->assign('operation_descr', $operation_descr);
$smarty->assign('user_feedback', $user_feedback);
$smarty->assign('user_action', $args->do_action);
renderGui($smarty, $args, $gui, $cfield_mgr, $templateCfg);
/*
  function: request2cf
            scan a hash looking for a keys with 'cf_' prefix,
            because this keys represents fields of Custom Fields
            tables.
            Is used to get values filled by user on a HTML form.
            This requirement dictated how html inputs must be named.
            If notation is not followed logic will fail.
  args: hash
  returns: hash only with related to custom fields, where
           (keys,values) are the original with 'cf_' prefix, but
           in this new hash prefix on key is removed.
           
  rev: 
      20090524 - franciscom - changes due to User Interface changes
示例#5
0
require_once require_web_editor($editorCfg['type']);
$req_cfg = config_get('req_cfg');
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$args = init_args();
$commandMgr = new reqSpecCommands($db);
$gui = initialize_gui($db, $commandMgr, $req_cfg);
$auditContext = new stdClass();
$auditContext->tproject = $args->tproject_name;
$commandMgr->setAuditContext($auditContext);
$pFn = $args->doAction;
$op = null;
if (method_exists($commandMgr, $pFn)) {
    $op = $commandMgr->{$pFn}($args, $_REQUEST);
}
renderGui($args, $gui, $op, $templateCfg, $editorCfg);
/**
 * 
 *
 */
function init_args()
{
    $args = new stdClass();
    $iParams = array("countReq" => array(tlInputParameter::INT_N, 99999), "req_spec_id" => array(tlInputParameter::INT_N), "reqParentID" => array(tlInputParameter::INT_N), "doAction" => array(tlInputParameter::STRING_N, 0, 250), "title" => array(tlInputParameter::STRING_N, 0, 100), "scope" => array(tlInputParameter::STRING_N), "doc_id" => array(tlInputParameter::STRING_N, 1, 32), "nodes_order" => array(tlInputParameter::ARRAY_INT), "containerID" => array(tlInputParameter::INT_N), "itemSet" => array(tlInputParameter::ARRAY_INT), "reqSpecType" => array(tlInputParameter::STRING_N, 0, 1), "copy_testcase_assignment" => array(tlInputParameter::CB_BOOL));
    $args = new stdClass();
    R_PARAMS($iParams, $args);
    $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
    $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : "";
    $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
    $args->basehref = $_SESSION['basehref'];
    $args->reqParentID = is_null($args->reqParentID) ? $args->tproject_id : $args->reqParentID;
示例#6
0
    case "fileUpload":
        fileUploadManagement($db, $args->tcase_id, $args->fileTitle, $tcase_mgr->getAttachmentTableName());
        $commandMgr->show($args, $_REQUEST, array('status_ok' => true), false);
        break;
    case "deleteFile":
        deleteAttachment($db, $args->file_id);
        $commandMgr->show($args, $_REQUEST, array('status_ok' => true), false);
        break;
    case "doAddRelation":
    case "doDeleteRelation":
        $op = $commandMgr->{$pfn}($args, $_REQUEST);
        $doRender = true;
        break;
}
if ($doRender) {
    renderGui($args, $gui, $op, $templateCfg, $cfg, $testCaseEditorKeys);
    exit;
}
// Things that one day will be managed by command file
if ($args->delete_tc_version) {
    $status_quo_map = $tcase_mgr->get_versions_status_quo($args->tcase_id);
    $exec_status_quo = $tcase_mgr->get_exec_status($args->tcase_id);
    $gui->delete_mode = 'single';
    $gui->delete_enabled = 1;
    $msg = '';
    $sq = null;
    if (!is_null($exec_status_quo)) {
        if (isset($exec_status_quo[$args->tcversion_id])) {
            $sq = array($args->tcversion_id => $exec_status_quo[$args->tcversion_id]);
        }
    }
 * @internal revisions
 * @since 1.9.4
 * 
**/
require_once "../../config.inc.php";
require_once "common.php";
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
list($args, $gui, $commandMgr) = initScript($db);
$pFn = $args->doAction;
$op = null;
if (method_exists($commandMgr, $pFn)) {
    $op = $commandMgr->{$pFn}($args, $_REQUEST);
}
// new dBug($op);
renderGui($db, $args, $gui, $op, $templateCfg);
/**
 */
function renderGui(&$dbHandler, &$argsObj, $guiObj, $opObj, $templateCfg)
{
    $smartyObj = new TLSmarty();
    $renderType = 'none';
    // key: gui action
    // value: next gui action (used to set value of action button on gui)
    $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doDelete' => '', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate');
    // Get rendering type and set variable for template
    switch ($argsObj->doAction) {
        case "edit":
        case "create":
        case "doDelete":
        case "doCreate":
示例#8
0
        break;
    case "delete":
    case "doDelete":
    case "createStep":
    case "editStep":
    case "doCreateStep":
    case "doCopyStep":
    case "doUpdateStep":
    case "doDeleteStep":
    case "doReorderSteps":
        $op = $commandMgr->{$pfn}($args, $_REQUEST);
        $doRender = true;
        break;
}
if ($doRender) {
    renderGui($args, $gui, $op, $templateCfg, $cfg);
    exit;
}
if ($args->delete_tc_version) {
    $status_quo_map = $tcase_mgr->get_versions_status_quo($args->tcase_id);
    $exec_status_quo = $tcase_mgr->get_exec_status($args->tcase_id);
    $msg = '';
    $sq = null;
    if (!is_null($exec_status_quo)) {
        if (isset($exec_status_quo[$args->tcversion_id])) {
            $sq = array($args->tcversion_id => $exec_status_quo[$args->tcversion_id]);
        }
    }
    if (intval($status_quo_map[$args->tcversion_id]['executed'])) {
        $msg = lang_get('warning') . TITLE_SEP . lang_get('delete_linked_and_exec');
    } else {
示例#9
0
    case 'edit':
        $op->role = tlRole::getByID($db, $args->roleid);
        break;
    case 'doCreate':
    case 'doUpdate':
        if ($canManage) {
            $op = doOperation($db, $args, $args->doAction);
            $templateCfg->template = $op->template;
        }
        break;
    default:
        break;
}
$gui = complete_gui($db, $gui, $args, $op->role, $owebeditor);
$gui->userFeedback = $op->userFeedback;
renderGui($args, $gui, $templateCfg);
function init_args()
{
    $iParams = array("rolename" => array("POST", tlInputParameter::STRING_N, 0, 100), "roleid" => array("REQUEST", tlInputParameter::INT_N), "doAction" => array("REQUEST", tlInputParameter::STRING_N, 0, 100), "notes" => array("POST", tlInputParameter::STRING_N), "grant" => array("POST", tlInputParameter::ARRAY_STRING_N), "tproject_id" => array("REQUEST", tlInputParameter::INT_N));
    $args = new stdClass();
    I_PARAMS($iParams, $args);
    $args->basehref = $_SESSION['basehref'];
    return $args;
}
function doOperation(&$dbHandler, $argsObj, $operation)
{
    $rights = implode("','", array_keys($argsObj->grant));
    $op = new stdClass();
    $op->role = new tlRole();
    $op->role->rights = tlRight::getAll($dbHandler, "WHERE description IN ('{$rights}')");
    $op->role->name = $argsObj->rolename;