Example #1
0
function web_editor($html_input_id, $base_path, $editor_cfg = null)
{
    $webEditorCfg = is_null($editor_cfg) ? getWebEditorCfg() : $editor_cfg;
    switch ($webEditorCfg['type']) {
        case 'fckeditor':
            $of = new fckeditor($html_input_id);
            $of->BasePath = $base_path . 'third_party/fckeditor/';
            $of->ToolbarSet = $webEditorCfg['toolbar'];
            $of->Config['CustomConfigurationsPath'] = $base_path . $webEditorCfg['configFile'];
            if (isset($webEditorCfg['height'])) {
                $of->Height = $webEditorCfg['height'];
            }
            if (isset($webEditorCfg['width'])) {
                $of->Width = $webEditorCfg['width'];
            }
            break;
        case 'tinymce':
            $of = new tinymce($html_input_id);
            if (isset($webEditorCfg['rows'])) {
                $of->rows = $webEditorCfg['rows'];
            }
            if (isset($webEditorCfg['cols'])) {
                $of->cols = $webEditorCfg['cols'];
            }
            break;
        case 'none':
        default:
            $of = new no_editor($html_input_id);
            if (isset($webEditorCfg['rows'])) {
                $of->rows = $webEditorCfg['rows'];
            }
            if (isset($webEditorCfg['cols'])) {
                $of->cols = $webEditorCfg['cols'];
            }
            break;
    }
    return $of;
}
Example #2
0
 *
 * test project management
 *
 * @filesource  projectEdit.php
 * @package     TestLink
 * @copyright   2007-2015, TestLink community 
 * @link        http://www.testlink.org
 *
 * @internal revisions
 * @since 1.9.14
 *
 */
require_once '../../config.inc.php';
require_once 'common.php';
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('testproject');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, true, false, "checkRights");
$gui_cfg = config_get('gui');
$templateCfg = templateConfiguration();
$session_tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0);
$template = null;
$ui = new stdClass();
$ui->doActionValue = '';
$ui->buttonValue = '';
$ui->caption = '';
$ui->main_descr = lang_get('title_testproject_management');
$user_feedback = '';
$reloadType = 'none';
// domain 'none','reloadNavBar'
$tproject_mgr = new testproject($db);
Example #3
0
 * @copyright 	2009-2011, TestLink community 
 * @link 		http://www.teamst.org/index.php
 *
 * allows users to manage platforms. 
 *
 * @internal Revision:
 * 20110409 - franciscom - BUGID 4368: Provide WYSIWYG Editor
 * 20101101 - franciscom - refactoring to remove event viewer warnings
 *
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "csv.inc.php";
require_once "xml.inc.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('build');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$default_template = $templateCfg->default_template;
$args = init_args($db);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = init_gui($db, $args);
$smarty = new TLSmarty();
$op = new stdClass();
$op->status = 0;
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('platform_template', $of->InstanceName, $args->notes);
$platform_mgr = new tlPlatform($db, $args->tproject_id);
$action = $args->doAction;
switch ($action) {
Example #4
0
function getCfg()
{
    $cfg = new stdClass();
    $cfg->treemenu_default_testcase_order = config_get('treemenu_default_testcase_order');
    $cfg->spec = config_get('spec_cfg');
    $cfg->exclude_node_types = array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1);
    $cfg->tcase_template = config_get('testcase_template');
    $cfg->webEditorCfg = getWebEditorCfg('design');
    $cfg->editorKeys = new stdClass();
    $cfg->editorKeys->testcase = array('summary' => true, 'preconditions' => true);
    $cfg->editorKeys->step = array('steps' => true, 'expected_results' => true);
    return $cfg;
}
 *
 * Manages test plans
 *
 * @package   TestLink
 * @copyright 2007-2014, TestLink community 
 * @version   planEdit.php
 * @link      http://www.testlink.org/
 *
 *
 * @internal revisions
 * @since 1.9.13
 **/
require_once '../../config.inc.php';
require_once "common.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('testplan');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$smarty = new TLSmarty();
$do_display = false;
$template = null;
$args = init_args($_REQUEST);
if (!$args->tproject_id) {
    $smarty->assign('title', lang_get('fatal_page_title'));
    $smarty->assign('content', lang_get('error_no_testprojects_present'));
    $smarty->display('workAreaSimple.tpl');
    exit;
}
Example #6
0
 * This script is distributed under the GNU General Public License 2 or later. 
 *
 * Filename $RCSfile: editExecution.php,v $
 *
 * @version $Revision: 1.4 $
 * @modified $Date: 2009/09/04 19:22:37 $ by $Author: schlundus $
 *
 * Edit an execution notes and custom fields
 *
 * rev: 20090530 - franciscom - BUGID 
**/
require_once '../../config.inc.php';
require_once 'common.php';
require_once 'exec.inc.php';
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('execution');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, false, false, "checkRights");
$gui = new stdClass();
$templateCfg = templateConfiguration();
$tcase_mgr = new testcase($db);
$args = init_args();
$gui->exec_id = $args->exec_id;
$gui->tcversion_id = $args->tcversion_id;
$gui->tplan_id = $args->tplan_id;
$gui->tproject_id = $args->tproject_id;
$owebeditor = web_editor('notes', $args->basehref, $editorCfg);
switch ($args->doAction) {
    case 'edit':
        break;
    case 'doUpdate':
Example #7
0
 * rev: 
 *  20100810 - asimon - BUGID 3317: disabled total count of requirements by default
 *  20100808 - aismon - added logic to refresh filtered tree on action
 *	20091202 - franciscom - fixed bug on webeditor value init.
 *	20091119 - franciscom - doc_id
 *	20080830 - franciscom - added code to manage unlimited depth tree
 *                         (will be not enabled yet)
 *
 *  20080827 - franciscom - BUGID 1692 
 *
 */
require_once "../../config.inc.php";
require_once "common.php";
require_once 'requirements.inc.php';
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('requirement_spec');
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);
}
Example #8
0
 *
 * @filesource  containerEdit.php
 * @package     TestLink
 * @author      Martin Havlat
 * @copyright   2005-2014, TestLink community
 * @link        http://www.testlink.org
 *
 * @internal revisions
 * @since 1.9.13
 * 
 */
require_once "../../config.inc.php";
require_once "common.php";
require_once "opt_transfer.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('design');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$tree_mgr = new tree($db);
$tproject_mgr = new testproject($db);
$tsuite_mgr = new testsuite($db);
$tcase_mgr = new testcase($db);
$template_dir = 'testcases/';
$refreshTree = false;
// Option Transfer configuration
$opt_cfg = new stdClass();
$opt_cfg->js_ot_name = 'ot';
$args = init_args($db, $opt_cfg);
$level = $args->containerType;
$gui_cfg = config_get('gui');
$smarty = new TLSmarty();
Example #9
0
function getCfg()
{
    $cfg = new stdClass();
    $cfg->exec_cfg = config_get('exec_cfg');
    $cfg->gui_cfg = config_get('gui');
    $cfg->bts_type = config_get('interface_bugs');
    $results = config_get('results');
    $cfg->tc_status = $results['status_code'];
    $cfg->testcase_cfg = config_get('testcase_cfg');
    $cfg->editorCfg = getWebEditorCfg('execution');
    return $cfg;
}
/**
 * TestLink Open Source Project - http://testlink.sourceforge.net/
 * This script is distributed under the GNU General Public License 2 or later.
 *
 * @filesource  rolesEdit.php
 *
 * @internal revisions 
 * @since 1.9.7
 * 
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "users.inc.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('role');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, false, false, "checkRights");
init_global_rights_maps();
$templateCfg = templateConfiguration();
$args = init_args();
$gui = initialize_gui($args, $editorCfg['type']);
$op = initialize_op();
$owebeditor = web_editor('notes', $args->basehref, $editorCfg);
$owebeditor->Value = getItemTemplateContents('role_template', $owebeditor->InstanceName, null);
$canManage = $args->user->hasRight($db, "role_management") ? true : false;
switch ($args->doAction) {
    case 'create':
        break;
    case 'edit':
        $op->role = tlRole::getByID($db, $args->roleid);
Example #11
0
/**
 * initWebEditors
 *
 */
function initWebEditors()
{
    $editorCfg = getWebEditorCfg('design');
    $editorSet = new stdClass();
    $editorSet->jsControls = array();
    $editorSet->templates = 'testsuite_template';
    $editorSet->inputNames = array('details');
    foreach ($editorSet->inputNames as $key) {
        $editorSet->jsControls[$key] = web_editor($key, $_SESSION['basehref'], $editorCfg);
    }
    return $editorSet;
}
Example #12
0
 * @author 		  Martin Havlat
 *
 * Screen to view existing requirements within a req. specification.
 *
 * @internal revisions
 * @since 2.0
 *  
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "users.inc.php";
require_once 'requirements.inc.php';
require_once "xml.inc.php";
require_once "configCheck.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('requirement');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$commandMgr = new reqCommands($db);
$args = init_args($db);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = initialize_gui($db, $args, $commandMgr);
$pFn = $args->doAction;
$op = null;
if (method_exists($commandMgr, $pFn)) {
    $op = $commandMgr->{$pFn}($args, $_REQUEST);
}
renderGui($args, $gui, $op, $templateCfg, $editorCfg, $db);
/**
 * init_args
function web_editor($html_input_id, $base_path, $editor_cfg = null)
{
    $webEditorCfg = is_null($editor_cfg) ? getWebEditorCfg() : $editor_cfg;
    switch ($webEditorCfg['type']) {
        case 'fckeditor':
            $of = new fckeditor($html_input_id);
            $of->BasePath = $base_path . 'third_party/fckeditor/';
            $of->ToolbarSet = $webEditorCfg['toolbar'];
            $of->Config['CustomConfigurationsPath'] = $base_path . $webEditorCfg['configFile'];
            if (isset($webEditorCfg['height'])) {
                $of->Height = $webEditorCfg['height'];
            }
            if (isset($webEditorCfg['width'])) {
                $of->Width = $webEditorCfg['width'];
            }
            break;
        case 'ckeditor':
            // CKEditor Language according to chosen Testlink language
            $locale = isset($_SESSION['locale']) ? $_SESSION['locale'] : 'en_GB';
            //$ckeditorLang;
            switch ($locale) {
                case 'cs_CZ':
                    $ckeditorLang = 'cs';
                    break;
                case 'de_DE':
                    $ckeditorLang = 'de';
                    break;
                case 'en_GB':
                    $ckeditorLang = 'en-gb';
                    break;
                case 'en_US':
                    $ckeditorLang = 'en';
                    break;
                case 'es_AR':
                    $ckeditorLang = 'es';
                    break;
                case 'es_ES':
                    $ckeditorLang = 'es';
                    break;
                case 'fi_FI':
                    $ckeditorLang = 'fi';
                    break;
                case 'fr_FR':
                    $ckeditorLang = 'fr';
                    break;
                case 'id_ID':
                    $ckeditorLang = 'en-gb';
                    break;
                case 'it_IT':
                    $ckeditorLang = 'it';
                    break;
                case 'ja_JP':
                    $ckeditorLang = 'ja';
                    break;
                case 'ko_KR':
                    $ckeditorLang = 'ko';
                    break;
                case 'nl_NL':
                    $ckeditorLang = 'nl';
                    break;
                case 'pl_PL':
                    $ckeditorLang = 'pl';
                    break;
                case 'pt_BR':
                    $ckeditorLang = 'pt-br';
                    break;
                case 'ru_RU':
                    $ckeditorLang = 'ru';
                    break;
                case 'zh_CN':
                    $ckeditorLang = 'zh-cn';
                    break;
                default:
                    $ckeditorLang = 'en-gb';
                    break;
            }
            $of = new ckeditorInterface($html_input_id);
            $of->Editor->basePath = $base_path . 'third_party/ckeditor/';
            $of->Editor->config['customConfig'] = $base_path . $webEditorCfg['configFile'];
            $of->Editor->config['toolbar'] = $webEditorCfg['toolbar'];
            $of->Editor->config['language'] = $ckeditorLang;
            if (isset($webEditorCfg['height'])) {
                $of->Editor->config['height'] = $webEditorCfg['height'];
            }
            if (isset($webEditorCfg['width'])) {
                $of->Editor->config['width'] = $webEditorCfg['width'];
            }
            break;
        case 'tinymce':
            $of = new tinymce($html_input_id);
            if (isset($webEditorCfg['rows'])) {
                $of->rows = $webEditorCfg['rows'];
            }
            if (isset($webEditorCfg['cols'])) {
                $of->cols = $webEditorCfg['cols'];
            }
            break;
        case 'none':
        default:
            $of = new no_editor($html_input_id);
            if (isset($webEditorCfg['rows'])) {
                $of->rows = $webEditorCfg['rows'];
            }
            if (isset($webEditorCfg['cols'])) {
                $of->cols = $webEditorCfg['cols'];
            }
            break;
    }
    return $of;
}
 * @internal revisions
 * @since 1.9.14
 *
 *
 */
require_once '../../config.inc.php';
require_once 'common.php';
require_once "web_editor.php";
require_once 'exec.inc.php';
$webeditorCfg = getWebEditorCfg('execution');
require_once require_web_editor($webeditorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tcase_mgr = new testcase($db);
$args = init_args();
$webeditorCfg = getWebEditorCfg('display_execution_notes');
$map = get_execution($db, $args->exec_id);
$notesContent = $map[0]['notes'];
$readonly = $args->readonly > 0 ? 'readonly="readonly"' : '';
$smarty = new TLSmarty();
$smarty->assign('notes', $notesContent);
$smarty->assign('webeditorCfg', $webeditorCfg);
$smarty->assign('webeditorType', $webeditorCfg['type']);
$smarty->assign('readonly', $readonly);
$smarty->assign('editor_instance', 'exec_notes_' . $args->exec_id);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function createExecNotesWebEditor($id, $basehref, $editorCfg, $content = null)
{
    // Important Notice:
    //
    // When using tinymce or none as web editor, we need to set rows and cols
Example #15
0
function getCfg()
{
    $cfg = new stdClass();
    $cfg->webEditorCfg = getWebEditorCfg('testproject');
    return $cfg;
}