diff --git a/cfg/const.inc.php b/cfg/const.inc.php index 3673b97dd4..ccae4069b2 100644 --- a/cfg/const.inc.php +++ b/cfg/const.inc.php @@ -1,990 +1,1217 @@ -exec_cfg->expand_collapse - very important do not change values, logic depends on values*/ -define('LAST_USER_CHOICE',2); -define('COLLAPSE', 0); -define('EXPAND',1 ); - -// used in several functions instead of MAGIC NUMBERS - Don't change -define('ALL_PRODUCTS', 0); -define('TP_ALL_STATUS', null); -define('FILTER_BY_PRODUCT', 1); -define('FILTER_BY_TESTPROJECT', 1); -define('TP_STATUS_ACTIVE', 1); - -define('DO_LANG_GET',1 ); -define('DONT_DO_LANG_GET',0 ); - -define('LANG_GET_NO_WARNING',true); - -define('DSN', FALSE); // for method connect() of database.class -define('ANY_BUILD', null); -define('GET_NO_EXEC', 1); - -define('FILTER_OPTION_ANY', 0); - -/** @uses planTCNavigator.php */ -define('FILTER_BY_BUILD_OFF', 0); -define('FILTER_BY_OWNER_OFF', 0); -define('FILTER_BY_TC_STATUS_OFF', null); -define('FILTER_BY_KEYWORD_OFF', null); -define('FILTER_BY_ASSIGNED_TO_OFF', 0); -define('SEARCH_BY_CUSTOM_FIELDS_OFF', null); -define('COLOR_BY_TC_STATUS_OFF', null); -define('CREATE_TC_STATUS_COUNTERS_OFF', 0); - -// moved from testSetRemove.php -define('WRITE_BUTTON_ONLY_IF_LINKED', 1); - -// moved from tc_exec_assignment.php -define('FILTER_BY_TC_OFF', null); -define('FILTER_BY_EXECUTE_STATUS_OFF', null); -define('ALL_USERS_FILTER', null); -define('ADD_BLANK_OPTION', true); - -// -define('FILTER_BY_SHOW_ON_EXECUTION', 1); - -define('GET_ALSO_NOT_EXECUTED', null); -define('GET_ONLY_EXECUTED', 'executed'); - -// generateTestSpecTree() -define('FOR_PRINTING', 1); -define('NOT_FOR_PRINTING', 0); - -define('HIDE_TESTCASES', 1); -define('SHOW_TESTCASES', 0); -define('FILTER_INACTIVE_TESTCASES', 1); -define('DO_NOT_FILTER_INACTIVE_TESTCASES', 0); - -define('ACTION_TESTCASE_DISABLE', 0); -define('IGNORE_INACTIVE_TESTCASES', 1); -define('IGNORE_ACTIVE_TESTCASES', 2); - -define('DO_ON_TESTCASE_CLICK', 1); -define('NO_ADDITIONAL_ARGS', ''); -define('NO_KEYWORD_ID_TO_FILTER', 0); - - -define('RECURSIVE_MODE', TRUE); -define('NO_NODE_TYPE_TO_FILTER', null); -define('ANY_OWNER', null); - -define('ALL_BUILDS', 'a'); -define('ALL_PLATFORMS', 'a'); -define('ALL_TEST_SUITES', 'all'); - -/** @todo use consts ACTIVE || INACTIVE, OPEN || CLOSED*/ -define('GET_ACTIVE_BUILD', 1); -define('GET_INACTIVE_BUILD', 0); -define('GET_OPEN_BUILD', 1); -define('GET_CLOSED_BUILD', 0); - -define('AUTOMATIC_ID', 0); -define('NO_FILTER_SHOW_ON_EXEC', null); -define('DONT_REFRESH', 0); -define('DEFAULT_TC_ORDER', 0); - -// bug_interface->buildViewBugLink() -define('GET_BUG_SUMMARY', true); - -// gen_spec_view() -define('DO_PRUNE', 1); - -// executeTestCase() -define('AUTOMATION_RESULT_KO', -1); -define('AUTOMATION_NOTES_KO', -1); - -define('REMOVEME', 'd8ba8cfb-ca92-4fa5-83c2-551977d405fb'); - -/** Constants for plugins */ -/** Plugin configuration types */ -define('CONFIG_TYPE_STRING', 0); -define('CONFIG_TYPE_INT', 1); -define('CONFIG_TYPE_FLOAT', 2); -define('CONFIG_TYPE_COMPLEX', 3); - -/** To indicate the plugin configuration belongs to ANY PROJECT */ -define('TL_ANY_PROJECT', -1); - -/** Constants for events */ -define('EVENT_TYPE_CREATE', 1); -define('EVENT_TYPE_UPDATE', 2); -define('EVENT_TYPE_DELETE', 3); -define('EVENT_TYPE_OUTPUT', 4); - - - - -// --------------------------------------------------------------------------------- -/* [GUI] */ - -/** - * @uses planAddTC_m1-tpl - * - **/ -define('TL_STYLE_FOR_ADDED_TC', 'background-color:yellow;'); - -/** Browser Cookie keeptime */ -define('TL_COOKIE_KEEPTIME', (time()+60*60*24*30)); // 30 days - -// needed for drap and drop feature -define('TL_DRAG_DROP_DIR', 'gui/drag_and_drop/'); -define('TL_DRAG_DROP_JS_DIR', TL_DRAG_DROP_DIR. 'js/'); -define('TL_DRAG_DROP_FOLDER_CSS', TL_DRAG_DROP_DIR . 'css/drag-drop-folder-tree.css'); -define('TL_DRAG_DROP_CONTEXT_MENU_CSS', TL_DRAG_DROP_DIR . 'css/context-menu.css'); - -/** Mark up inactive objects (test projects, etc) in GUI lists */ -define('TL_INACTIVE_MARKUP', '* '); - -/** @var string Delimiter used when created a test suite path, concatenating test suite names */ -$g_testsuite_sep='/'; - -/** - * using niftycorners - * @TODO havlatm: move to smarty templates - configuration should not contain HTML elements - **/ -define('MENU_ITEM_OPEN', '
- * $results_cfg = config_get('results');
- * lang_get($results_cfg['status_label']["passed"]);
- *
- */
-$tlCfg->results['status_label'] = array('not_run' => 'test_status_not_run',
- 'passed' => 'test_status_passed',
- 'failed' => 'test_status_failed',
- 'blocked'=> 'test_status_blocked',
- 'all' => 'test_status_all_status',
- 'not_available' => 'test_status_not_available',
- 'unknown' => 'test_status_unknown');
-
-// Is RIGHT to have this configuration DIFFERENT from $tlCfg->results['status_label'],
-// because you must choose to not allow some of previous status be available
-// on execution page.
-// See this as a subset of $tlCfg->results['status_label']
-//
-// Used to generate radio and buttons at user interface level.
-//
-// IMPORTANT NOTE ABOUT ORDER:
-// Order is important, because this will be display order on User Interface
-// And will be used on every feature that will need to do ordering
-// according Test Case Execution Status.
-//
-//
-// key => verbose status as defined in $tlCfg->results['status_code']
-// value => string id defined in the strings.txt file,
-// used to localize the strings.
-//
-$tlCfg->results['status_label_for_exec_ui'] = array('not_run' => 'test_status_not_run',
- 'passed' => 'test_status_passed',
- 'failed' => 'test_status_failed',
- 'blocked' => 'test_status_blocked');
-
-
-$tlCfg->results['status_icons_for_exec_ui'] =
- array('passed' => array('img' => 'test_status_passed',
- 'title' => 'click_passed'),
- 'failed' => array('img' => 'test_status_failed',
- 'title' => 'click_failed'),
- 'blocked' => array('img' => 'test_status_blocked',
- 'title' => 'click_blocked'));
-
-$tlCfg->results['status_icons_for_exec_next_ui'] =
- array('passed' => array('img' => 'test_status_passed_next',
- 'title' => 'click_passed_next'),
- 'failed' => array('img' => 'test_status_failed_next',
- 'title' => 'click_failed_next'),
- 'blocked' => array('img' => 'test_status_blocked_next',
- 'title' => 'click_blocked_next'));
-
-
-$tlCfg->results['execStatusToExclude'] = array();
-$tlCfg->results['execStatusToExclude']['testcase'] =
- array($tlCfg->results['status_code']['all']);
-
-$tlCfg->results['execStatusToExclude']['step'] =
- array($tlCfg->results['status_code']['all']);
-
-
-/**
- * Selected execution result by default. Values is key from $tlCfg->results['status_label']
- * @var string
- **/
-$tlCfg->results['default_status'] = 'not_run';
-
-/**
- * Status colours for charts - use just RGB (not colour names)
- * Colours should be compiant with definition in CSS
- **/
-$tlCfg->results['charts']['status_colour'] = array('not_run' => '000000','passed' => '006400',
- 'failed' => 'B22222','blocked' => '00008B');
-
-/*
- * arrays for new filter types (BUGID 2455, BUGID 3026)
- * used for testcase execution
- */
-$tlCfg->execution_filter_methods['status_code'] = array('latest_execution' => 1,
- 'all_builds' => 2,
- 'any_build' => 3,
- 'specific_build' => 4,
- 'current_build' => 5);
-
-$tlCfg->execution_filter_methods['status_label'] = array('latest_execution' => 'filter_result_latest_execution',
- 'all_builds' => 'filter_result_all_builds',
- 'any_build' => 'filter_result_any_build',
- 'specific_build' => 'filter_result_specific_build',
- 'current_build' => 'filter_result_current_build');
-
-$tlCfg->execution_filter_methods['default_type'] = $tlCfg->execution_filter_methods['status_code']['current_build'];
-
-/*
- * same as above, but without current build
- * these are used for testcase execution assignment
- */
-$tlCfg->execution_assignment_filter_methods['status_code'] = array('latest_execution' => 1,
- 'all_builds' => 2,
- 'any_build' => 3,
- 'specific_build' => 4);
-
-$tlCfg->execution_assignment_filter_methods['status_label'] = array('latest_execution' => 'filter_result_latest_execution',
- 'all_builds' => 'filter_result_all_builds',
- 'any_build' => 'filter_result_any_build',
- 'specific_build' => 'filter_result_specific_build');
-
-// CRITIC NOTICE
-// This values has to have certain coerence with
-// $js_key_to_select on init_filter_result() in tlTestCaseFilterControl.class.php
-//
-$tlCfg->execution_assignment_filter_methods['default_type'] =
- $tlCfg->execution_assignment_filter_methods['status_code']['specific_build'];
-
-
-
-// --------------------------------------------------------------------------------------
-/* [Users & Roles] */
-
-define('TL_USER_NOBODY', -1);
-define('TL_USER_SOMEBODY', -2); //new user for new filtertypes in 2455 & 3026
-define('TL_NO_USER', TL_USER_NOBODY);
-define('TL_USER_ANYBODY', 0);
-
-/** Follows CODES present in roles table - DO NOT CHANGE ON ANY CIRCUNSTANCE */
-define('TL_ROLES_MANAGER', 1);
-define('TL_ROLES_ADMIN', 8);
-define('TL_ROLES_LEADER', 9);
-define('TL_ROLES_TESTER', 7);
-define('TL_ROLES_GUEST', 5);
-define('TL_ROLES_NO_RIGHTS', 3);
-define('TL_ROLES_UNDEFINED', 0);
-define('TL_ROLES_INHERITED', 0);
-
-// Roles with id > to this role can be deleted from user interface
-define('TL_LAST_SYSTEM_ROLE', 9);
-
-
-// used on user management page to give different colour
-// to different roles.
-// If you don't want use colouring then configure in this way
-// $g_role_colour = array ( );
-$g_role_colour = array (
- 'admin' => 'white',
- 'tester' => 'wheat',
- 'leader' => 'acqua',
- 'senior tester' => '#FFA',
- 'guest' => 'pink',
- 'test designer' => 'cyan',
- '
+ * $results_cfg = config_get('results');
+ * lang_get($results_cfg['status_label']["passed"]);
+ *
+ */
+$tlCfg->results['status_label'] = array(
+ 'not_run' => 'test_status_not_run',
+ 'passed' => 'test_status_passed',
+ 'failed' => 'test_status_failed',
+ 'blocked' => 'test_status_blocked',
+ 'all' => 'test_status_all_status',
+ 'not_available' => 'test_status_not_available',
+ 'unknown' => 'test_status_unknown'
+);
+
+// Is RIGHT to have this configuration DIFFERENT from $tlCfg->results['status_label'],
+// because you must choose to not allow some of previous status be available
+// on execution page.
+// See this as a subset of $tlCfg->results['status_label']
+//
+// Used to generate radio and buttons at user interface level.
+//
+// IMPORTANT NOTE ABOUT ORDER:
+// Order is important, because this will be display order on User Interface
+// And will be used on every feature that will need to do ordering
+// according Test Case Execution Status.
+//
+//
+// key => verbose status as defined in $tlCfg->results['status_code']
+// value => string id defined in the strings.txt file,
+// used to localize the strings.
+//
+$tlCfg->results['status_label_for_exec_ui'] = array(
+ 'not_run' => 'test_status_not_run',
+ 'passed' => 'test_status_passed',
+ 'failed' => 'test_status_failed',
+ 'blocked' => 'test_status_blocked'
+);
+
+$tlCfg->results['status_icons_for_exec_ui'] = array(
+ 'passed' => array(
+ 'img' => 'test_status_passed',
+ 'title' => 'click_passed'
+ ),
+ 'failed' => array(
+ 'img' => 'test_status_failed',
+ 'title' => 'click_failed'
+ ),
+ 'blocked' => array(
+ 'img' => 'test_status_blocked',
+ 'title' => 'click_blocked'
+ )
+);
+
+$tlCfg->results['status_icons_for_exec_next_ui'] = array(
+ 'passed' => array(
+ 'img' => 'test_status_passed_next',
+ 'title' => 'click_passed_next'
+ ),
+ 'failed' => array(
+ 'img' => 'test_status_failed_next',
+ 'title' => 'click_failed_next'
+ ),
+ 'blocked' => array(
+ 'img' => 'test_status_blocked_next',
+ 'title' => 'click_blocked_next'
+ )
+);
+
+$tlCfg->results['execStatusToExclude'] = array();
+$tlCfg->results['execStatusToExclude']['testcase'] = array(
+ $tlCfg->results['status_code']['all']
+);
+
+$tlCfg->results['execStatusToExclude']['step'] = array(
+ $tlCfg->results['status_code']['all']
+);
+
+/**
+ * Selected execution result by default.
+ * Values is key from $tlCfg->results['status_label']
+ *
+ * @var string
+ */
+$tlCfg->results['default_status'] = 'not_run';
+
+/**
+ * Status colours for charts - use just RGB (not colour names)
+ * Colours should be compiant with definition in CSS
+ */
+$tlCfg->results['charts']['status_colour'] = array(
+ 'not_run' => '000000',
+ 'passed' => '006400',
+ 'failed' => 'B22222',
+ 'blocked' => '00008B'
+);
+
+/*
+ * arrays for new filter types (BUGID 2455, BUGID 3026)
+ * used for testcase execution
+ */
+$tlCfg->execution_filter_methods['status_code'] = array(
+ 'latest_execution' => 1,
+ 'all_builds' => 2,
+ 'any_build' => 3,
+ 'specific_build' => 4,
+ 'current_build' => 5
+);
+
+$tlCfg->execution_filter_methods['status_label'] = array(
+ 'latest_execution' => 'filter_result_latest_execution',
+ 'all_builds' => 'filter_result_all_builds',
+ 'any_build' => 'filter_result_any_build',
+ 'specific_build' => 'filter_result_specific_build',
+ 'current_build' => 'filter_result_current_build'
+);
+
+$tlCfg->execution_filter_methods['default_type'] = $tlCfg->execution_filter_methods['status_code']['current_build'];
+
+/*
+ * same as above, but without current build
+ * these are used for testcase execution assignment
+ */
+$tlCfg->execution_assignment_filter_methods['status_code'] = array(
+ 'latest_execution' => 1,
+ 'all_builds' => 2,
+ 'any_build' => 3,
+ 'specific_build' => 4
+);
+
+$tlCfg->execution_assignment_filter_methods['status_label'] = array(
+ 'latest_execution' => 'filter_result_latest_execution',
+ 'all_builds' => 'filter_result_all_builds',
+ 'any_build' => 'filter_result_any_build',
+ 'specific_build' => 'filter_result_specific_build'
+);
+
+// CRITIC NOTICE
+// This values has to have certain coerence with
+// $js_key_to_select on init_filter_result() in tlTestCaseFilterControl.class.php
+//
+$tlCfg->execution_assignment_filter_methods['default_type'] = $tlCfg->execution_assignment_filter_methods['status_code']['specific_build'];
+
+// --------------------------------------------------------------------------------------
+/* [Users & Roles] */
+
+define('TL_USER_NOBODY', - 1);
+define('TL_USER_SOMEBODY', - 2); // new user for new filtertypes in 2455 & 3026
+define('TL_NO_USER', TL_USER_NOBODY);
+define('TL_USER_ANYBODY', 0);
+
+/**
+ * Follows CODES present in roles table - DO NOT CHANGE ON ANY CIRCUNSTANCE
+ */
+define('TL_ROLES_MANAGER', 1);
+define('TL_ROLES_ADMIN', 8);
+define('TL_ROLES_LEADER', 9);
+define('TL_ROLES_TESTER', 7);
+define('TL_ROLES_GUEST', 5);
+define('TL_ROLES_NO_RIGHTS', 3);
+define('TL_ROLES_UNDEFINED', 0);
+define('TL_ROLES_INHERITED', 0);
+
+// Roles with id > to this role can be deleted from user interface
+define('TL_LAST_SYSTEM_ROLE', 9);
+
+// used on user management page to give different colour
+// to different roles.
+// If you don't want use colouring then configure in this way
+// $g_role_colour = array ( );
+$g_role_colour = array(
+ 'admin' => 'white',
+ 'tester' => 'wheat',
+ 'leader' => 'acqua',
+ 'senior tester' => '#FFA',
+ 'guest' => 'pink',
+ 'test designer' => 'cyan',
+ '
- * $regex = "/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*" .
- * "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i";
- * $regex = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/";
- *
- **/
-//
-// This expression does not allow Top Level Domian (last part of domain name) longer than 4
-// If you need to change this
-// Configure this on custom_config.inc.php
-$tlCfg->validation_cfg->user_email_valid_regex_js = "/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,4}$/";
-$tlCfg->validation_cfg->user_email_valid_regex_php = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/U";
-
-
-// --------------------------------------------------------------------------------------
-/* [API] */
-
-/** XML-RPC API availability - do less than promised ;)
- FALSE => user are not able to generate and set his/her API key.
- XML-RPC server do not check this config in order to answer or not a call.
- */
-
-$tlCfg->api->enabled = TRUE;
-
-// used to display API ID info in the *View pages
-$tlCfg->api->id_format = "[ID: %s ]";
-
-
-// ---------------------------------------------------------------------------------
-/* [GUI LAYOUT] */
-
-/** Company logo (used by navigation bar and login page page) */
-$tlCfg->logo_login = 'tl-logo-transparent-25.png';
-$tlCfg->logo_navbar = 'tl-logo-transparent-12.5.png';
-
-/** Height of the navbar always displayed */
-$tlCfg->navbar_height = 70;
-
-/** Login page could show an informational text */
-$tlCfg->login_info = ''; // Empty by default
-
-
-
-/**
- * controls if pagination (via Javascript) will be enabled
- */
-$tlCfg->gui->projectView = new stdClass();
-$tlCfg->gui->projectView->pagination = new stdClass();
-$tlCfg->gui->projectView->pagination->enabled = true;
-$tlCfg->gui->projectView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
-
-$tlCfg->gui->usersAssign = new stdClass();
-$tlCfg->gui->usersAssign->pagination = new stdClass();
-$tlCfg->gui->usersAssign->pagination->enabled = true;
-$tlCfg->gui->usersAssign->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
-
-$tlCfg->gui->planView = new stdClass();
-$tlCfg->gui->planView->pagination = new stdClass();
-$tlCfg->gui->planView->pagination->enabled = true;
-$tlCfg->gui->planView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
-$tlCfg->gui->planView->itemQtyForTopButton = 10;
-
-$tlCfg->gui->buildView = new stdClass();
-$tlCfg->gui->buildView->pagination = new stdClass();
-$tlCfg->gui->buildView->pagination->enabled = true;
-$tlCfg->gui->buildView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
-$tlCfg->gui->buildView->itemQtyForTopButton = 10;
-
-$tlCfg->gui->keywordsView = new stdClass();
-$tlCfg->gui->keywordsView->pagination = new stdClass();
-$tlCfg->gui->keywordsView->pagination->enabled = true;
-$tlCfg->gui->keywordsView->pagination->length = '[40, 60, 80, -1], [40, 60, 80, "All"]';
-$tlCfg->gui->keywordsView->itemQtyForTopButton = 10;
-
-
-
-/**
- * controls if operation area (buttons) starts open ('' or 'inline') or closed ('none') on:
- * - test suite management
- * - test case management
- * - req. spec management
- * - req. management
- */
-$tlCfg->gui->op_area_display = new stdClass();
-
-// test_spec_container => test project, test suite
-$tlCfg->gui->op_area_display->test_spec_container = 'none'; // ''
-$tlCfg->gui->op_area_display->test_case = 'none'; // 'inline'
-$tlCfg->gui->op_area_display->req_spec_container = 'none'; // 'inline'
-$tlCfg->gui->op_area_display->req = 'none'; // 'inline'
-
-
-
-/**
- * @var string Availability of Test Project specific background colour
- * 'background' -> standard behaviour for 1.6.x you can have a different
- * background colour for every test project.
- * 'none' -> new behaviour no background color change
- */
-$tlCfg->gui->testproject_coloring = 'none'; // I'm sorry default is not coloring using coloring is a pain
- // and useless
-/** @TODO havlatm4francisco Ok, then merge these two attributes into one */
-/** default background color */
-$tlCfg->gui->background_color = '#9BD';
-
-// ENABLED: on features that assign user role to test projects and test plan, colour user name
-// according GLOBAL role
-// DISABLED: do not color [STANDARD BEHAVIOUR]
-$tlCfg->gui->usersAssignGlobalRoleColoring = DISABLED;
-
-
-// Enable/disable rounded corners via javascript
-$tlCfg->gui->round_corners = new stdClass();
-$tlCfg->gui->round_corners->exec_history = ENABLED;
-$tlCfg->gui->round_corners->tc_title = ENABLED;
-$tlCfg->gui->round_corners->tc_spec = ENABLED;
-
-/**
- * Display name definition (used to build a human readable display name for users)
- * Example of values:
- * '%first% %last%' -> John Cook
- * '%last%, %first%' -> Cook John
- * '%first% %last% %login%' -> John Cook [ux555]
- **/
-$tlCfg->username_format = '%login%';
-
-/** Configure the frame frmWorkArea navigator width */
-$tlCfg->frame_workarea_default_width = "30%";
-
-/** true => icon edit will be added into as indication an edit features */
-$tlCfg->gui->show_icon_edit = false;
-
-/**
- * '' => test project name
- * 'prefix' => prefix : test project name
- *
- * ATTENTION : * is used to indicate test project is INACTIVE
- * see also $tlCfg->gui->tprojects_combo_order_by
- */
-$tlCfg->gui->tprojects_combo_format = 'prefix';
-
-
-/**
- * Order to use when building a testproject combobox (value must be SQL compliant)
- * For example:
- * 'ORDER BY name'
- * 'ORDER_BY nodes_hierarchy.id DESC' -> similar effect to order last created firts
- **/
-// $tlCfg->gui->tprojects_combo_order_by = 'ORDER BY nodes_hierarchy.id DESC';
-$tlCfg->gui->tprojects_combo_order_by = 'ORDER BY TPROJ.prefix ASC';
-
-
-
-/** Configure the input size of test case search by id on navigation bar.
- * This value will be added to the length of the prefix to dynamically set input size.
- * Example: prefix is "projectA-" -> length of prefix is 9
- * Now the here defined value (default: 6) will be added to the prefix length
- * -> Input field will have an input size of 15
- **/
-$tlCfg->gui->dynamic_quick_tcase_search_input_size = 6;
-
-// used to round percentages on metricsDashboard.php
-$tlCfg->dashboard_precision = 2;
-
-/**
- * Choose what kind of webeditor you want to use in every TL area. This configuration
- * will be used if no element with search key (area) is found on this structure.
- * Every element is a mp with this configuration keys:
- *
- * 'type':
- * 'ckeditor'
- * 'tinymce' ==> will be deprecated in future versions
- * 'none' -> use plain text area input field
- * 'toolbar': only applicable for type = 'fckeditor', 'ckeditor'
- * name of ToolbarSet (See: http://docs.fckeditor.net/ for more information about ToolbarSets)
- * TestLink stores own definitions in
- * // Copy this to custom_config.inc.php if you want use 'tinymce' as default.
- * $tlCfg->gui->text_editor['all'] = array( 'type' => 'tinymce');
- * // Copy this to custom_config.inc.php if you want use 'nome' as default.
- * $tlCfg->gui->text_editor['all'] = array( 'type' => 'none');
- * //This configuration is useful only if default type is set to 'fckeditor'
- * $tlCfg->gui->text_editor['design'] = array('toolbar' => 'tl_mini');
- *
- * $tlCfg->gui->text_editor['testplan'] = array( 'type' => 'none');
- * $tlCfg->gui->text_editor['build'] = array( 'type' => 'fckeditor','toolbar' => 'tl_mini');
- * $tlCfg->gui->text_editor['testproject'] = array( 'type' => 'tinymce');
- * $tlCfg->gui->text_editor['role'] = array( 'type' => 'tinymce');
- * $tlCfg->gui->text_editor['requirement'] = array( 'type' => 'none');
- * $tlCfg->gui->text_editor['requirement_spec'] = array( 'type' => 'none');
- *
- *
- * Hint: After doing configuration changes, clean you Browser's cookies and cache
- */
-/*
-$tlCfg->gui->text_editor = array();
-$tlCfg->gui->text_editor['all'] = array('type' => 'fckeditor',
- 'toolbar' => 'tl_default',
- 'configFile' => 'cfg/tl_ckeditor_config.js',);
-$tlCfg->gui->text_editor['execution'] = array( 'type' => 'none');
-*/
-
-$tlCfg->gui->text_editor = array();
-$tlCfg->gui->text_editor['all'] = ['type' => 'ckeditor',
- 'toolbar' => 'Testlink',
- 'configFile' => 'cfg/tl_ckeditor_config.js',
- 'height' => 150];
-
-
-// mini toolbar for test case steps edit
-$tlCfg->gui->text_editor['steps_design'] = ['type' => 'ckeditor',
- 'toolbar' => 'TestlinkMini',
- 'configFile' => 'cfg/tl_ckeditor_config.js',
- 'height' => 100];
-
-//
-$tlCfg->gui->text_editor['preconditions'] = ['type' => 'ckeditor',
- 'toolbar' => 'Testlink',
- 'configFile' => 'cfg/tl_ckeditor_config.js',
- 'height' => 150
- ];
-
-$tlCfg->gui->text_editor['summary'] = ['type' => 'ckeditor',
- 'toolbar' => 'Testlink',
- 'configFile' => 'cfg/tl_ckeditor_config.js',
- 'height' => 600
- ];
-
-
-
-$tlCfg->gui->text_editor['execution'] = array('type' => 'none');
-$tlCfg->gui->text_editor['edit_execution'] = array('type' => 'none', 'cols' => 80, 'rows' => 20);
-$tlCfg->gui->text_editor['display_execution_notes'] = array('type' => 'none', 'cols' => 80, 'rows' => 20);
-
-/** User can choose order of menu areas */
-$tlCfg->gui->layoutMainPageLeft = array( 'testProject' => 1, 'userAdministration' => 2 ,
- 'requirements' => 3, 'testSpecification' => 4,
- 'general' => 5);
-$tlCfg->gui->layoutMainPageRight = array( 'testPlan' => 1, 'testExecution' => 2 ,
- 'testPlanContents' => 3);
-
-/**
- * Enable warning on a changed content before an user leave a page.
- *
- * Tested in:
- * - IE8 OK
- * - Firefox 3 OK
- * - Chrome FAIL
- *
- * Does not work in Webkit browsers (Chrome, Safari) when using frames.
- * Bug in webkit: https://bugs.webkit.org/show_bug.cgi?id=19418
- */
-
-// seems that with config options that will be used on javascript via smarty template variables
-// we are having problems using FALSE/TRUE => use 0/1 (or our CONSTANT DISABLED/ENABLED)
-$tlCfg->gui->checkNotSaved = ENABLED;
-
-
-// ----------------------------------------------------------------------------
-/* [GUI: TREE] */
-
-/** Default ordering value for new Test Suites and Test Cases to separate them */
-$tlCfg->treemenu_default_testsuite_order = 1;
-$tlCfg->treemenu_default_testcase_order = 1000;
-
-/** show/hide testcase id on tree menu */
-$tlCfg->treemenu_show_testcase_id = TRUE;
-
-/** Reorder test cases based on TC Name or External ID in tree on
- * test suite level using reorder button
- */
-// 'EXTERNAL_ID' -> Sort on Test Case External ID field displayed on tree.(Default)
-// 'NAME' -> Sort on Test Case Name field
-
-$tlCfg->testcase_reorder_by = 'EXTERNAL_ID';
-// $tlCfg->testcase_reorder_by = 'NAME';
-
-// ----------------------------------------------------------------------------
-/* [GUI: Javascript libraries] */
-
-// May be in future another table sort engine will be better
-// kryogenix.org -> Stuart Langridge sortTable
-// '' (empty string) -> disable table sorting feature
-$g_sort_table_engine='kryogenix.org';
-
-
-// --------------------------------------------------------------------------------------
-/* [Reports] */
-$tlCfg->reportsCfg=new stdClass();
-
-//Displayed execution statuses to use on reports (ordered). */
-$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui'];
-
-/**
- * Default Offset in seconds for reporting start date (reports with date range)
- * @uses lib/results/resultsMoreBuilds.php
- */
-$tlCfg->reportsCfg->start_date_offset = (7*24*60*60); // one week
-
-// minutes part is ignored but must be configured.
-// Hint: set always to :00
-$tlCfg->reportsCfg->start_time = '00:00';
-
-// Result matrix (resultsTC.php)
-$tlCfg->resultMatrixReport = new stdClass();
-
-// Shows an extra column with the result of the latest execution on
-// the lastest CREATED build
-$tlCfg->resultMatrixReport->buildColumns['showExecutionResultLatestCreatedBuild'] = true;
-
-// Result matrix (resultsTC.php)
-// Shows an extra column with the note of latest execution on
-// the lastest CREATED build
-$tlCfg->resultMatrixReport->buildColumns['showExecutionNoteLatestCreatedBuild'] = true;
-
-// Show build columns in revers order. The latest build is to the left
-$tlCfg->resultMatrixReport->buildColumns['latestBuildOnLeft'] = false;
-
-// After having got performance and usability issue, a limit on max qty of builds
-// allowed on data extration has been set.
-// Is absolutely arbitrary
-//
-$tlCfg->resultMatrixReport->buildQtyLimit = 6;
-
-// ORDER BY sql clause, refers to builds table columns
-$tlCfg->resultMatrixReport->buildOrderByClause = " ORDER BY name ASC";
-
-
-// Show all available status details for test plans on metrics dashboard
-$tlCfg->metrics_dashboard = new stdClass();
-$tlCfg->metrics_dashboard->show_test_plan_status = false;
-
-
-
-
-// ----------------------------------------------------------------------------
-/* [GENERATED DOCUMENTATION] */
-
-/**
- * Texts and settings for printed documents
- * Image is expected in directory
';
-$tlCfg->attachments->access_string = "[*]";
-
-/**
- * Files that are allowed. Separate items by commas.
- * eg. 'doc,xls,gif,png,jpg'
- */
-$tlCfg->attachments->allowed_files = 'doc,xls,gif,png,jpg,xlsx,csv';
-
-
-/**
- * Process filename against XSS
- * Thanks to http://owasp.org/index.php/Unrestricted_File_Upload
- * '/^[a-zA-Z0-9]{1,20}\.[a-zA-Z0-9]{1,10}$/';
- * added - and _.
- *
- * NO CHECK if -> $g_attachments->allowed_filenames_regexp = '';
- *
- */
-$tlCfg->attachments->allowed_filenames_regexp = '/^[a-zA-Z0-9_-]{1,20}\.[a-zA-Z0-9]{1,10}$/';
-
-
-/** the type of the repository can be database or filesystem
- * TL_REPOSITORY_TYPE_DB => database
- * TL_REPOSITORY_TYPE_FS => filesystem
- **/
-$g_repositoryType = TL_REPOSITORY_TYPE_FS;
-
-/**
- * TL_REPOSITORY_TYPE_FS: the where the filesystem repository should be located
- * We recommend to change the directory for security reason.
- * (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/)
- * Put it out of reach via web or configure access denied.
- *
- **/
-$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */
-if (($upa = getenv('TESTLINK_UPLOAD_AREA'))) {
- $g_repositoryPath = trim($upa);
-}
-
-/**
- * compression used within the repository
- * TL_REPOSITORY_COMPRESSIONTYPE_NONE => no compression
- * TL_REPOSITORY_COMPRESSIONTYPE_GZIP => gzip compression
- */
-$g_repositoryCompressionType = TL_REPOSITORY_COMPRESSIONTYPE_NONE;
-
-// the maximum allowed file size for each repository entry, default 1MB.
-// Also check your PHP settings (default is usually 2MBs)
-$tlCfg->repository_max_filesize = 1; //MB
-
-
-
-
-// ----------------------------------------------------------------------------
-/* [Requirements] */
-
-// HAS TO BE REMOVED - > req_doc_id UNIQUE INSIDE test project
-// true : you want req_doc_id UNIQUE IN THE WHOLE DB (system_wide)
-// false: you want req_doc_id UNIQUE INSIDE a SRS
-// $tlCfg->req_cfg->reqdoc_id->is_system_wide = FALSE;
-
-$tlCfg->req_cfg->monitor_enabled = true;
-
-// truncate log message to this amount of chars for reqCompareVersions
-$tlCfg->req_cfg->log_message_len = 200;
-
-/**
- * Test Case generation from Requirements - use_req_spec_as_testsuite_name
- * FALSE => test cases are created and assigned to a test suite
- * with name $tlCfg->req_cfg->default_testsuite_name
- * TRUE => REQuirement Specification Title is used as testsuite name
- */
-$tlCfg->req_cfg->use_req_spec_as_testsuite_name = TRUE;
-$tlCfg->req_cfg->default_testsuite_name = "Auto-created Test cases";
-$tlCfg->req_cfg->testsuite_details = "Test Cases in the Test Suite are generated from Requirements. " .
- "A refinement of test scenario is highly recommended.";
-$tlCfg->req_cfg->testcase_summary_prefix = "The Test Case was generated from the assigned requirement.
';
-}
-
-
-// Important to do this only after custom_* to use (if exists) redefinition of
-// $tlCfg->results['status_label_for_exec_ui']
-$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui'];
-
-
-/** Support for localization */
-// @TODO move the code out of config and do it only once and
-// not always in any include!
-// @TODO a better parsing function should be include
-$serverLanguage = false;
-if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
-{
- @list($code) = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
- @list($a,$b) = explode("-",$code);
- if ($a && $b)
- {
- $a = strtolower($a);
- $b = strtoupper($a);
- $serverLanguage = $a."_".$b;
- }
-}
-
-if(false !== $serverLanguage)
-{
- if (array_key_exists($serverLanguage,$tlCfg->locales))
- {
- $tlCfg->default_language = $serverLanguage;
- }
-}
-define ('TL_DEFAULT_LOCALE', $tlCfg->default_language);
-
-// Reverted execution status is used for two applications.
-// 1. To map code to CSS, Please if you add an status you need to add a corresponding CSS Class
-// in the CSS files (see the gui directory)
-// 2. to decode from code to some more human oriented to use in code
-//
-/** Revered list of Test Case execution results */
-$tlCfg->results['code_status'] = array_flip($tlCfg->results['status_code']);
-
-// Enable CSRF global protection
-$tlCfg->csrf_filter_enabled = TRUE;
-
-// ---------------------------------------------------------------------------------
-/** Converted and derived variables (Users should not modify this section) */
-define('REFRESH_SPEC_TREE',$tlCfg->spec_cfg->automatic_tree_refresh ? 1 : 0);
-define('TL_SORT_TABLE_ENGINE',$g_sort_table_engine);
-define("TL_REPOSITORY_MAXFILESIZE", 1024*1024*$tlCfg->repository_max_filesize);
-
-define('TL_XMLEXPORT_HEADER', "charset . "\"?>\n");
-
-
-
-// ---------------------------------------------------------------------------------
-// when a role is deleted, a new role must be assigned to all users
-// having role to be deleted
-// A right choice seems to be using $g_default_roleid.
-// You can change this adding a config line in custom_config.inc.php
-// @TODO martin: remove - use directly $tlCfg->default_roleid;
-$g_role_replace_for_deleted_roles = $tlCfg->default_roleid;
-
-
-/**
- * Using "|" in the testsuite name causes malformed URLs
- * regexp used to check for chars not allowed in:
- * test project, test suite and testcase names.
- * @TODO martin: encode harm characters @see http://cz.php.net/urlencode (and remove the parameter)
- *
- * now is preg pattern
- */
-$g_ereg_forbidden = "/[|]/i";
-
-
-
-/**
- * @TODO remove from TL - unfinished refactorization;
- * use $tlCfg instead of old variables and constants
- */
-define('TL_IMPORT_ROW_MAX', $tlCfg->import_max_row);
-define('TL_TPL_CHARSET', $tlCfg->charset);
-define('TITLE_SEP',$tlCfg->gui_title_separator_1);
-define('TITLE_SEP_TYPE2',$tlCfg->gui_title_separator_2);
-define('TITLE_SEP_TYPE3',$tlCfg->gui_title_separator_2); // obsolete: use type 1,2
-define('TL_FRMWORKAREA_LEFT_FRAME_WIDTH', $tlCfg->frame_workarea_default_width);
-define('TL_TEMP_PATH', $tlCfg->temp_dir);
-
-$tlCfg->gui->title_separator_1 = $tlCfg->gui_title_separator_1;
-$tlCfg->gui->title_separator_2 = $tlCfg->gui_title_separator_2;
-$tlCfg->gui->role_separator_open = $tlCfg->gui_separator_open;
-$tlCfg->gui->role_separator_close = $tlCfg->gui_separator_close;
-
-$tlCfg->gui->version_separator_open = $tlCfg->gui_separator_open;
-$tlCfg->gui->version_separator_close = $tlCfg->gui_separator_close;
-
-
-/**
- * Globals for Events storage
- */
-$g_event_cache = array();
-
-/**
- * Globals for Plugins
- */
+api = new stdClass();
+$tlCfg->cookie = new stdClass();
+$tlCfg->document_generator = new stdClass();
+
+$tlCfg->spec_cfg = new stdClass();
+
+$tlCfg->exec_cfg = new stdClass();
+$tlCfg->exec_cfg->view_mode = new stdClass();
+$tlCfg->exec_cfg->exec_mode = new stdClass();
+
+$tlCfg->UDFStripHTMLTags = true;
+
+// allow to define additional execution types other than
+// defined in testcase.class.php
+// array(code => lblkey)
+// code int value > latest standard execution code defined.
+// lblkey => key to be used on lang_get() call.
+//
+$tlCfg->custom_execution_types = null;
+
+$tlCfg->gui = new stdClass();
+$tlCfg->gui->custom_fields = new stdClass();
+$tlCfg->testcase_cfg = new stdClass();
+$tlCfg->req_cfg = new stdClass();
+$tlCfg->validation_cfg = new stdClass();
+$tlCfg->custom_fields = new stdClass();
+$tlCfg->req_spec_cfg = new stdClass();
+$tlCfg->diffEngine = new stdClass();
+$tlCfg->tplanDesign = new stdClass();
+
+$tlCfg->notifications = new stdClass();
+$tlCfg->proxy = new stdClass();
+
+$tlCfg->reqTCLinks = new stdClass();
+
+$tlCfg->keywords = new stdClass();
+
+$tlCfg->keywords->annotations = [
+ "@TestCaseSpecDisplay:"
+];
+
+$tlCfg->keywords->onDeleteCheckFrozenTCVersions = true;
+$tlCfg->keywords->onDeleteCheckExecutedTCVersions = true;
+
+// main key testproject PREFIX
+// element array
+// 'addTCLinkIntoITS' true => add note to Issue Tracker to issue with
+// ISSUE ID similar to the KEYWORD (see kwPrefix below)
+//
+// 'kwPrefix' to remove from keyword to create the ISSUE ID
+//
+$tlCfg->keywords->byTestProject = array();
+
+$tlCfg->keywords->headsUpTSuiteOnExec = 'CMD_OPEN_ON_EXEC';
+
+$tlCfg->accessWithoutLogin = array();
+
+$tlCfg->platforms = new stdClass();
+$tlCfg->platforms->allowedOnAssign = [
+ 'enable_on_design' => false,
+ 'enable_on_execution' => true,
+ 'is_open' => true
+];
+
+/**
+ *
+ * @uses database access definition (generated automatically by TL installer)
+ */
+@include_once ('config_db.inc.php');
+if (! defined('DB_TABLE_PREFIX')) {
+ define('DB_TABLE_PREFIX', '');
+}
+
+/**
+ * The root dir for the testlink installation with trailing slash
+ */
+define('TL_ABS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+
+/**
+ * Just for documentation
+ */
+$tlCfg->testlinkdotorg = 'http://www.testlink.org';
+
+/**
+ * GUI themes (base for CSS and images)- modify if you create own one
+ */
+$tlCfg->theme_dir = 'gui/themes/default/';
+
+/**
+ * Dir for compiled templates
+ */
+$tlCfg->temp_dir = TL_ABS_PATH . 'gui' . DIRECTORY_SEPARATOR . 'templates_c' .
+ DIRECTORY_SEPARATOR;
+if ($tpltmp = getenv('TESTLINK_TEMPLATES_C')) {
+ $tlCfg->temp_dir = trim($tpltmp);
+}
+
+/**
+ * default filenames of CSS files of current GUI theme
+ */
+define('TL_CSS_MAIN', 'testlink.css');
+define('TL_CSS_PRINT', 'tl_print.css');
+define('TL_CSS_DOCUMENTS', 'tl_documents.css');
+
+define('TL_THEME_BASE_DIR', $tlCfg->theme_dir);
+define('TL_THEME_IMG_DIR', $tlCfg->theme_dir . 'images/');
+define('TL_THEME_CSS_DIR', $tlCfg->theme_dir . 'css/');
+define('TL_TESTLINK_CSS', TL_THEME_CSS_DIR . TL_CSS_MAIN);
+define('TL_PRINT_CSS', TL_THEME_CSS_DIR . TL_CSS_PRINT);
+
+// name of your custom.css, place it in same folder that standard TL css
+// null or '' => do not use
+$tlCfg->custom_css = null;
+
+/**
+ * Include constants and magic numbers (users should not change it)
+ */
+require_once (TL_ABS_PATH . 'cfg' . DIRECTORY_SEPARATOR . 'const.inc.php');
+
+// ----------------------------------------------------------------------------
+/**
+ *
+ * @var string used to have (when needed) a possibility to identify different TL instances
+ * @since 1.9.4 used on mail subject when mail logger is used
+ */
+$tlCfg->instance_name = 'Main TestLink Instance';
+
+// do not use blanks or special characters, use a short string
+$tlCfg->instance_id = 'TLM';
+
+$tlCfg->gui->ux = 'tl-classic';
+
+/**
+ * Copied from MantisBT
+ *
+ * Prefix for all TestLink cookies
+ * This should be an identifier which does not include spaces or periods,
+ * and should be unique per TestLink installation, especially if
+ * $tlCfg->cookie_path is not restricting the cookies' scope to the actual
+ * TestLink directory.
+ *
+ * @see $tlCfg->cookie->path
+ * @global string $tlCfg->cookie->prefix
+ */
+$tlCfg->cookie->prefix = 'TESTLINK1920';
+
+/**
+ *
+ * @link http://php.net/function.setcookie
+ *
+ */
+$tlCfg->cookie->expire = (time() + 60 * 60 * 24 * 30); // 30 days;
+$tlCfg->cookie->domain = '';
+$tlCfg->cookie->secure = false;
+$tlCfg->cookie->httponly = false;
+
+$tlCfg->cookie->testProjectMemory = $tlCfg->cookie->prefix . '_PROJ_ID_USER_ID_';
+
+/**
+ * Copied from MantisBT
+ *
+ * Specifies the path under which a cookie is visible
+ * All scripts in this directory and its sub-directories will be able
+ * to access TestLink cookies.
+ * It is recommended to set this to the actual TestLink path.
+ *
+ * @link http://php.net/function.setcookie
+ * @global string $tlCfg->cookie->path
+ */
+$tlCfg->cookie->path = '/';
+
+/* [ROLE INHERITANCE] */
+/**
+ * possible values
+ *
+ * 'testproject'
+ * 'global'
+ *
+ * 'testproject'
+ * till a role is specifically assigned to test plan, test plan role
+ * will be inherited from test project role.
+ *
+ * IMPORTANT NOTICE
+ * test project role can be specifically assigned or inherited from
+ * user's global role.
+ *
+ * if test project specifically assigned role changes, and test plan role was inherited, then it will also changes, due to inheritance.
+ *
+ *
+ * 'global'
+ * till a role is specifically assigned to test plan, test plan role
+ * will be inherited from user's global role, and NOT from test project
+ * specifically assigned role.
+ *
+ * if test project specifically assigned role changes, will not be changed.
+ */
+$tlCfg->testplan_role_inheritance_mode = 'testproject';
+
+/* [LOCALIZATION] */
+
+/** @var string Default localization for users */
+// The value must be available in $$tlCfg->locales (see cfg/const.inc.php).
+// Note: An attempt will be done to establish the default locale
+// automatically using $_SERVER['HTTP_ACCEPT_LANGUAGE']
+$tlCfg->default_language = 'en_GB';
+
+/**
+ *
+ * @var string Charset 'UTF-8' is only officially supported charset (Require
+ * MySQL version >= 4.1) 'ISO-8859-1' or another Charset could be set for
+ * backward compatability by experienced users. However we have not resources
+ * to support such patches.
+ */
+$tlCfg->charset = 'UTF-8';
+
+/**
+ *
+ * @var string characters used to surround a description in the user interface
+ * (for example role)
+ */
+$tlCfg->gui_separator_open = '[';
+$tlCfg->gui_separator_close = ']';
+$tlCfg->gui_room = '[ %s ]';
+
+/** @var string Title separators are used when componing an title using several strings */
+$tlCfg->gui_title_separator_1 = ' : '; // object : name (Test Specification : My best product)
+$tlCfg->gui_title_separator_2 = ' - '; // parent - child
+
+/**
+ *
+ * @var string delimiter used to create DOC ID in this way:
+ *
+ * $regex = "/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*" .
+ * "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i";
+ * $regex = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/";
+ *
+ */
+//
+// This expression does not allow Top Level Domian (last part of domain name) longer than 4
+// If you need to change this
+// Configure this on custom_config.inc.php
+$tlCfg->validation_cfg->user_email_valid_regex_js = "/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,4}$/";
+$tlCfg->validation_cfg->user_email_valid_regex_php = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/U";
+
+// --------------------------------------------------------------------------------------
+/* [API] */
+
+/**
+ * XML-RPC API availability - do less than promised ;)
+ * false => user are not able to generate and set his/her API key.
+ * XML-RPC server do not check this config in order to answer or not a call.
+ */
+
+$tlCfg->api->enabled = true;
+
+// used to display API ID info in the *View pages
+$tlCfg->api->id_format = "[ID: %s ]";
+
+// ---------------------------------------------------------------------------------
+/* [GUI LAYOUT] */
+
+/**
+ * Company logo (used by navigation bar and login page page)
+ */
+$tlCfg->logo_login = 'tl-logo-transparent-25.png';
+$tlCfg->logo_navbar = 'tl-logo-transparent-12.5.png';
+
+/**
+ * Height of the navbar always displayed
+ */
+$tlCfg->navbar_height = 70;
+
+/**
+ * Login page could show an informational text
+ */
+$tlCfg->login_info = ''; // Empty by default
+
+/**
+ * controls if pagination (via Javascript) will be enabled
+ */
+$tlCfg->gui->projectView = new stdClass();
+$tlCfg->gui->projectView->pagination = new stdClass();
+$tlCfg->gui->projectView->pagination->enabled = true;
+$tlCfg->gui->projectView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
+
+$tlCfg->gui->usersAssign = new stdClass();
+$tlCfg->gui->usersAssign->pagination = new stdClass();
+$tlCfg->gui->usersAssign->pagination->enabled = true;
+$tlCfg->gui->usersAssign->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
+
+$tlCfg->gui->planView = new stdClass();
+$tlCfg->gui->planView->pagination = new stdClass();
+$tlCfg->gui->planView->pagination->enabled = true;
+$tlCfg->gui->planView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
+$tlCfg->gui->planView->itemQtyForTopButton = 10;
+
+$tlCfg->gui->buildView = new stdClass();
+$tlCfg->gui->buildView->pagination = new stdClass();
+$tlCfg->gui->buildView->pagination->enabled = true;
+$tlCfg->gui->buildView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]';
+$tlCfg->gui->buildView->itemQtyForTopButton = 10;
+
+$tlCfg->gui->keywordsView = new stdClass();
+$tlCfg->gui->keywordsView->pagination = new stdClass();
+$tlCfg->gui->keywordsView->pagination->enabled = true;
+$tlCfg->gui->keywordsView->pagination->length = '[40, 60, 80, -1], [40, 60, 80, "All"]';
+$tlCfg->gui->keywordsView->itemQtyForTopButton = 10;
+
+/**
+ * controls if operation area (buttons) starts open ('' or 'inline') or closed ('none') on:
+ * - test suite management
+ * - test case management
+ * - req.
+ * spec management
+ * - req. management
+ */
+$tlCfg->gui->op_area_display = new stdClass();
+
+// test_spec_container => test project, test suite
+$tlCfg->gui->op_area_display->test_spec_container = 'none'; // ''
+$tlCfg->gui->op_area_display->test_case = 'none'; // 'inline'
+$tlCfg->gui->op_area_display->req_spec_container = 'none'; // 'inline'
+$tlCfg->gui->op_area_display->req = 'none'; // 'inline'
+
+/**
+ *
+ * @var string Availability of Test Project specific background colour
+ * 'background' -> standard behaviour for 1.6.x you can have a different
+ * background colour for every test project.
+ * 'none' -> new behaviour no background color change
+ */
+$tlCfg->gui->testproject_coloring = 'none'; // I'm sorry default is not coloring using coloring is a pain
+ // and useless
+/**
+ *
+ * @todo havlatm4francisco Ok, then merge these two attributes into one
+ */
+/**
+ * default background color
+ */
+$tlCfg->gui->background_color = '#9BD';
+
+// ENABLED: on features that assign user role to test projects and test plan, colour user name
+// according GLOBAL role
+// DISABLED: do not color [STANDARD BEHAVIOUR]
+$tlCfg->gui->usersAssignGlobalRoleColoring = DISABLED;
+
+// Enable/disable rounded corners via javascript
+$tlCfg->gui->round_corners = new stdClass();
+$tlCfg->gui->round_corners->exec_history = ENABLED;
+$tlCfg->gui->round_corners->tc_title = ENABLED;
+$tlCfg->gui->round_corners->tc_spec = ENABLED;
+
+/**
+ * Display name definition (used to build a human readable display name for users)
+ * Example of values:
+ * '%first% %last%' -> John Cook
+ * '%last%, %first%' -> Cook John
+ * '%first% %last% %login%' -> John Cook [ux555]
+ */
+$tlCfg->username_format = '%login%';
+
+/**
+ * Configure the frame frmWorkArea navigator width
+ */
+$tlCfg->frame_workarea_default_width = "30%";
+
+/**
+ * true => icon edit will be added into as indication an edit features
+ */
+$tlCfg->gui->show_icon_edit = false;
+
+/**
+ * '' => test project name
+ * 'prefix' => prefix : test project name
+ *
+ * ATTENTION : * is used to indicate test project is INACTIVE
+ * see also $tlCfg->gui->tprojects_combo_order_by
+ */
+$tlCfg->gui->tprojects_combo_format = 'prefix';
+
+/**
+ * Order to use when building a testproject combobox (value must be SQL compliant)
+ * For example:
+ * 'ORDER BY name'
+ * 'ORDER_BY nodes_hierarchy.id DESC' -> similar effect to order last created firts
+ */
+// $tlCfg->gui->tprojects_combo_order_by = 'ORDER BY nodes_hierarchy.id DESC';
+$tlCfg->gui->tprojects_combo_order_by = 'ORDER BY TPROJ.prefix ASC';
+
+/**
+ * Configure the input size of test case search by id on navigation bar.
+ * This value will be added to the length of the prefix to dynamically set input size.
+ * Example: prefix is "projectA-" -> length of prefix is 9
+ * Now the here defined value (default: 6) will be added to the prefix length
+ * -> Input field will have an input size of 15
+ */
+$tlCfg->gui->dynamic_quick_tcase_search_input_size = 6;
+
+// used to round percentages on metricsDashboard.php
+$tlCfg->dashboard_precision = 2;
+
+/**
+ * Choose what kind of webeditor you want to use in every TL area.
+ * This configuration
+ * will be used if no element with search key (area) is found on this structure.
+ * Every element is a mp with this configuration keys:
+ *
+ * 'type':
+ * 'ckeditor'
+ * 'tinymce' ==> will be deprecated in future versions
+ * 'none' -> use plain text area input field
+ * 'toolbar': only applicable for type = 'fckeditor', 'ckeditor'
+ * name of ToolbarSet (See: http://docs.fckeditor.net/ for more information about ToolbarSets)
+ * TestLink stores own definitions in
+ * // Copy this to custom_config.inc.php if you want use 'tinymce' as default.
+ * $tlCfg->gui->text_editor['all'] = array( 'type' => 'tinymce');
+ * // Copy this to custom_config.inc.php if you want use 'nome' as default.
+ * $tlCfg->gui->text_editor['all'] = array( 'type' => 'none');
+ * //This configuration is useful only if default type is set to 'fckeditor'
+ * $tlCfg->gui->text_editor['design'] = array('toolbar' => 'tl_mini');
+ *
+ * $tlCfg->gui->text_editor['testplan'] = array( 'type' => 'none');
+ * $tlCfg->gui->text_editor['build'] = array( 'type' => 'fckeditor','toolbar' => 'tl_mini');
+ * $tlCfg->gui->text_editor['testproject'] = array( 'type' => 'tinymce');
+ * $tlCfg->gui->text_editor['role'] = array( 'type' => 'tinymce');
+ * $tlCfg->gui->text_editor['requirement'] = array( 'type' => 'none');
+ * $tlCfg->gui->text_editor['requirement_spec'] = array( 'type' => 'none');
+ *
+ *
+ * Hint: After doing configuration changes, clean you Browser's cookies and cache
+ */
+/*
+ * $tlCfg->gui->text_editor = array();
+ * $tlCfg->gui->text_editor['all'] = array('type' => 'fckeditor',
+ * 'toolbar' => 'tl_default',
+ * 'configFile' => 'cfg/tl_ckeditor_config.js',);
+ * $tlCfg->gui->text_editor['execution'] = array( 'type' => 'none');
+ */
+
+$tlCfg->gui->text_editor = array();
+$tlCfg->gui->text_editor['all'] = [
+ 'type' => 'ckeditor',
+ 'toolbar' => 'Testlink',
+ 'configFile' => 'cfg/tl_ckeditor_config.js',
+ 'height' => 150
+];
+
+// mini toolbar for test case steps edit
+$tlCfg->gui->text_editor['steps_design'] = [
+ 'type' => 'ckeditor',
+ 'toolbar' => 'TestlinkMini',
+ 'configFile' => 'cfg/tl_ckeditor_config.js',
+ 'height' => 100
+];
+
+//
+$tlCfg->gui->text_editor['preconditions'] = [
+ 'type' => 'ckeditor',
+ 'toolbar' => 'Testlink',
+ 'configFile' => 'cfg/tl_ckeditor_config.js',
+ 'height' => 150
+];
+
+$tlCfg->gui->text_editor['summary'] = [
+ 'type' => 'ckeditor',
+ 'toolbar' => 'Testlink',
+ 'configFile' => 'cfg/tl_ckeditor_config.js',
+ 'height' => 600
+];
+
+$tlCfg->gui->text_editor['execution'] = array(
+ 'type' => 'none'
+);
+$tlCfg->gui->text_editor['edit_execution'] = array(
+ 'type' => 'none',
+ 'cols' => 80,
+ 'rows' => 20
+);
+$tlCfg->gui->text_editor['display_execution_notes'] = array(
+ 'type' => 'none',
+ 'cols' => 80,
+ 'rows' => 20
+);
+
+/**
+ * User can choose order of menu areas
+ */
+$tlCfg->gui->layoutMainPageLeft = array(
+ 'testProject' => 1,
+ 'userAdministration' => 2,
+ 'requirements' => 3,
+ 'testSpecification' => 4,
+ 'general' => 5
+);
+$tlCfg->gui->layoutMainPageRight = array(
+ 'testPlan' => 1,
+ 'testExecution' => 2,
+ 'testPlanContents' => 3
+);
+
+/**
+ * Enable warning on a changed content before an user leave a page.
+ *
+ * Tested in:
+ * - IE8 OK
+ * - Firefox 3 OK
+ * - Chrome FAIL
+ *
+ * Does not work in Webkit browsers (Chrome, Safari) when using frames.
+ * Bug in webkit: https://bugs.webkit.org/show_bug.cgi?id=19418
+ */
+
+// seems that with config options that will be used on javascript via smarty template variables
+// we are having problems using false/true => use 0/1 (or our CONSTANT DISABLED/ENABLED)
+$tlCfg->gui->checkNotSaved = ENABLED;
+
+// ----------------------------------------------------------------------------
+/* [GUI: TREE] */
+
+/**
+ * Default ordering value for new Test Suites and Test Cases to separate them
+ */
+$tlCfg->treemenu_default_testsuite_order = 1;
+$tlCfg->treemenu_default_testcase_order = 1000;
+
+/**
+ * show/hide testcase id on tree menu
+ */
+$tlCfg->treemenu_show_testcase_id = true;
+
+/**
+ * Reorder test cases based on TC Name or External ID in tree on
+ * test suite level using reorder button
+ */
+// 'EXTERNAL_ID' -> Sort on Test Case External ID field displayed on tree.(Default)
+// 'NAME' -> Sort on Test Case Name field
+
+$tlCfg->testcase_reorder_by = 'EXTERNAL_ID';
+// $tlCfg->testcase_reorder_by = 'NAME';
+
+// ----------------------------------------------------------------------------
+/* [GUI: Javascript libraries] */
+
+// May be in future another table sort engine will be better
+// kryogenix.org -> Stuart Langridge sortTable
+// '' (empty string) -> disable table sorting feature
+$g_sort_table_engine = 'kryogenix.org';
+
+// --------------------------------------------------------------------------------------
+/* [Reports] */
+$tlCfg->reportsCfg = new stdClass();
+
+// Displayed execution statuses to use on reports (ordered). */
+$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui'];
+
+/**
+ * Default Offset in seconds for reporting start date (reports with date range)
+ *
+ * @uses lib/results/resultsMoreBuilds.php
+ */
+$tlCfg->reportsCfg->start_date_offset = (7 * 24 * 60 * 60); // one week
+
+// minutes part is ignored but must be configured.
+// Hint: set always to :00
+$tlCfg->reportsCfg->start_time = '00:00';
+
+// Result matrix (resultsTC.php)
+$tlCfg->resultMatrixReport = new stdClass();
+
+// Shows an extra column with the result of the latest execution on
+// the lastest CREATED build
+$tlCfg->resultMatrixReport->buildColumns['showExecutionResultLatestCreatedBuild'] = true;
+
+// Result matrix (resultsTC.php)
+// Shows an extra column with the note of latest execution on
+// the lastest CREATED build
+$tlCfg->resultMatrixReport->buildColumns['showExecutionNoteLatestCreatedBuild'] = true;
+
+// Show build columns in revers order. The latest build is to the left
+$tlCfg->resultMatrixReport->buildColumns['latestBuildOnLeft'] = false;
+
+// After having got performance and usability issue, a limit on max qty of builds
+// allowed on data extration has been set.
+// Is absolutely arbitrary
+//
+$tlCfg->resultMatrixReport->buildQtyLimit = 6;
+
+// ORDER BY sql clause, refers to builds table columns
+$tlCfg->resultMatrixReport->buildOrderByClause = " ORDER BY name ASC";
+
+// Show all available status details for test plans on metrics dashboard
+$tlCfg->metrics_dashboard = new stdClass();
+$tlCfg->metrics_dashboard->show_test_plan_status = false;
+
+// ----------------------------------------------------------------------------
+/* [GENERATED DOCUMENTATION] */
+
+/**
+ * Texts and settings for printed documents
+ * Image is expected in directory
';
+$tlCfg->attachments->access_string = "[*]";
+
+/**
+ * Files that are allowed.
+ * Separate items by commas.
+ * eg. 'doc,xls,gif,png,jpg'
+ */
+$tlCfg->attachments->allowed_files = 'doc,xls,gif,png,jpg,xlsx,csv';
+
+/**
+ * Process filename against XSS
+ * Thanks to http://owasp.org/index.php/Unrestricted_File_Upload
+ * '/^[a-zA-Z0-9]{1,20}\.[a-zA-Z0-9]{1,10}$/';
+ * added - and _.
+ *
+ * NO CHECK if -> $g_attachments->allowed_filenames_regexp = '';
+ */
+$tlCfg->attachments->allowed_filenames_regexp = '/^[a-zA-Z0-9_-]{1,20}\.[a-zA-Z0-9]{1,10}$/';
+
+/**
+ * the type of the repository can be database or filesystem
+ * TL_REPOSITORY_TYPE_DB => database
+ * TL_REPOSITORY_TYPE_FS => filesystem
+ */
+$g_repositoryType = TL_REPOSITORY_TYPE_FS;
+
+/**
+ * TL_REPOSITORY_TYPE_FS: the where the filesystem repository should be located
+ * We recommend to change the directory for security reason.
+ * (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/)
+ * Put it out of reach via web or configure access denied.
+ */
+$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */
+if ($upa = getenv('TESTLINK_UPLOAD_AREA')) {
+ $g_repositoryPath = trim($upa);
+}
+
+/**
+ * compression used within the repository
+ * TL_REPOSITORY_COMPRESSIONTYPE_NONE => no compression
+ * TL_REPOSITORY_COMPRESSIONTYPE_GZIP => gzip compression
+ */
+$g_repositoryCompressionType = TL_REPOSITORY_COMPRESSIONTYPE_NONE;
+
+// the maximum allowed file size for each repository entry, default 1MB.
+// Also check your PHP settings (default is usually 2MBs)
+$tlCfg->repository_max_filesize = 1; // MB
+
+// ----------------------------------------------------------------------------
+/* [Requirements] */
+
+// HAS TO BE REMOVED - > req_doc_id UNIQUE INSIDE test project
+// true : you want req_doc_id UNIQUE IN THE WHOLE DB (system_wide)
+// false: you want req_doc_id UNIQUE INSIDE a SRS
+// $tlCfg->req_cfg->reqdoc_id->is_system_wide = false;
+
+$tlCfg->req_cfg->monitor_enabled = true;
+
+// truncate log message to this amount of chars for reqCompareVersions
+$tlCfg->req_cfg->log_message_len = 200;
+
+/**
+ * Test Case generation from Requirements - use_req_spec_as_testsuite_name
+ * false => test cases are created and assigned to a test suite
+ * with name $tlCfg->req_cfg->default_testsuite_name
+ * true => REQuirement Specification Title is used as testsuite name
+ */
+$tlCfg->req_cfg->use_req_spec_as_testsuite_name = true;
+$tlCfg->req_cfg->default_testsuite_name = "Auto-created Test cases";
+$tlCfg->req_cfg->testsuite_details = "Test Cases in the Test Suite are generated from Requirements. " .
+ "A refinement of test scenario is highly recommended.";
+$tlCfg->req_cfg->testcase_summary_prefix = "The Test Case was generated from the assigned requirement.
';
+}
+
+// Important to do this only after custom_* to use (if exists) redefinition of
+// $tlCfg->results['status_label_for_exec_ui']
+$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui'];
+
+/**
+ * Support for localization
+ */
+// @TODO move the code out of config and do it only once and
+// not always in any include!
+// @TODO a better parsing function should be include
+$serverLanguage = false;
+if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ @list ($code) = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ @list ($a, $b) = explode("-", $code);
+ if ($a && $b) {
+ $a = strtolower($a);
+ $b = strtoupper($a);
+ $serverLanguage = $a . "_" . $b;
+ }
+}
+
+if (false !== $serverLanguage &&
+ array_key_exists($serverLanguage, $tlCfg->locales)) {
+ $tlCfg->default_language = $serverLanguage;
+}
+define('TL_DEFAULT_LOCALE', $tlCfg->default_language);
+
+// Reverted execution status is used for two applications.
+// 1. To map code to CSS, Please if you add an status you need to add a corresponding CSS Class
+// in the CSS files (see the gui directory)
+// 2. to decode from code to some more human oriented to use in code
+//
+/**
+ * Revered list of Test Case execution results
+ */
+$tlCfg->results['code_status'] = array_flip($tlCfg->results['status_code']);
+
+// Enable CSRF global protection
+$tlCfg->csrf_filter_enabled = true;
+
+// ---------------------------------------------------------------------------------
+/**
+ * Converted and derived variables (Users should not modify this section)
+ */
+define('REFRESH_SPEC_TREE', $tlCfg->spec_cfg->automatic_tree_refresh ? 1 : 0);
+define('TL_SORT_TABLE_ENGINE', $g_sort_table_engine);
+define("TL_REPOSITORY_MAXFILESIZE",
+ 1024 * 1024 * $tlCfg->repository_max_filesize);
+
+define('TL_XMLEXPORT_HEADER',
+ "charset . "\"?>\n");
+
+// ---------------------------------------------------------------------------------
+// when a role is deleted, a new role must be assigned to all users
+// having role to be deleted
+// A right choice seems to be using $g_default_roleid.
+// You can change this adding a config line in custom_config.inc.php
+// @TODO martin: remove - use directly $tlCfg->default_roleid;
+$g_role_replace_for_deleted_roles = $tlCfg->default_roleid;
+
+/**
+ * Using "|" in the testsuite name causes malformed URLs
+ * regexp used to check for chars not allowed in:
+ * test project, test suite and testcase names.
+ *
+ * @todo martin: encode harm characters @see http://cz.php.net/urlencode (and remove the parameter)
+ *
+ * now is preg pattern
+ */
+$g_ereg_forbidden = "/[|]/i";
+
+/**
+ *
+ * @todo remove from TL - unfinished refactorization;
+ * use $tlCfg instead of old variables and constants
+ */
+define('TL_IMPORT_ROW_MAX', $tlCfg->import_max_row);
+define('TL_TPL_CHARSET', $tlCfg->charset);
+define('TITLE_SEP', $tlCfg->gui_title_separator_1);
+define('TITLE_SEP_TYPE2', $tlCfg->gui_title_separator_2);
+define('TITLE_SEP_TYPE3', $tlCfg->gui_title_separator_2); // obsolete: use type 1,2
+define('TL_FRMWORKAREA_LEFT_FRAME_WIDTH', $tlCfg->frame_workarea_default_width);
+define('TL_TEMP_PATH', $tlCfg->temp_dir);
+
+$tlCfg->gui->title_separator_1 = $tlCfg->gui_title_separator_1;
+$tlCfg->gui->title_separator_2 = $tlCfg->gui_title_separator_2;
+$tlCfg->gui->role_separator_open = $tlCfg->gui_separator_open;
+$tlCfg->gui->role_separator_close = $tlCfg->gui_separator_close;
+
+$tlCfg->gui->version_separator_open = $tlCfg->gui_separator_open;
+$tlCfg->gui->version_separator_close = $tlCfg->gui_separator_close;
+
+/**
+ * Globals for Events storage
+ */
+$g_event_cache = array();
+
+/**
+ * Globals for Plugins
+ */
$g_plugin_config_cache = array();
// ----- END OF FILE --------------------------------------------------------------------
diff --git a/custom/_cf_radio_head.php b/custom/_cf_radio_head.php
index 2ec9963a7f..1a1e949f59 100644
--- a/custom/_cf_radio_head.php
+++ b/custom/_cf_radio_head.php
@@ -1,86 +1,82 @@
-custom_fields->types = array(100 => 'radio head');
- * $tlCfg->custom_fields->possible_values_cfg = array('radio head' => 1);
- *
- *
- *
- * -----------------------------------------------------------------------------
-*/
-/*
- function: string_input_radio_head
- returns an string with the html need to display "radio head" custom field.
- Is normally called by string_custom_field_input()
-
- args: p_field_def: contains the definition of the custom field
- (including it's field id)
-
- p_input_name: html input name
-
- p_custom_field_value: html input value
- htmlspecialchars() must be applied to this
- argument by caller.
-
- returns: html string
-
- rev: based on Mantis 1.2.0a1 code
-
- */
-function string_input_radio_head($p_field_def, $p_input_name, $p_custom_field_value )
-{
- $str_out='';
- $t_values = explode( '|', $p_field_def['possible_values']);
- $t_checked_values = explode( '|', $p_custom_field_value );
- foreach( $t_values as $t_option )
- {
- $str_out .= ' ' . $t_option . ' ';
- }
- else
- {
- $str_out .= ' value="' . $t_option . '"> ' . $t_option . ' ';
- }
- }
- return $str_out;
-}
-
-/*
- function: build_cfield_radio_head
- support function useful for method used to write "radio head" CF values to db.
- Is normally called by _build_cfield()
-
- args: custom_field_value: value to be converted to be written to db.
-
- returns: value converted
-
-
- */
-
-function build_cfield_radio_head($custom_field_value)
-{
- if( count($value) > 1)
- {
- $value=implode('|',$custom_field_value);
- }
- else
- {
- $value=is_array($custom_field_value) ? $custom_field_value[0] :$custom_field_value;
- }
- return $value;
-
-}
-?>
\ No newline at end of file
+custom_fields->types = array(100 => 'radio head');
+ * $tlCfg->custom_fields->possible_values_cfg = array('radio head' => 1);
+ *
+ *
+ *
+ * -----------------------------------------------------------------------------
+ */
+/*
+ * function: string_input_radio_head
+ * returns an string with the html need to display "radio head" custom field.
+ * Is normally called by string_custom_field_input()
+ *
+ * args: p_field_def: contains the definition of the custom field
+ * (including it's field id)
+ *
+ * p_input_name: html input name
+ *
+ * p_custom_field_value: html input value
+ * htmlspecialchars() must be applied to this
+ * argument by caller.
+ *
+ * returns: html string
+ *
+ * rev: based on Mantis 1.2.0a1 code
+ *
+ */
+function string_input_radio_head($p_field_def, $p_input_name,
+ $p_custom_field_value)
+{
+ $str_out = '';
+ $t_values = explode('|', $p_field_def['possible_values']);
+ $t_checked_values = explode('|', $p_custom_field_value);
+ foreach ($t_values as $t_option) {
+ $str_out .= ' ' .
+ $t_option . ' ';
+ } else {
+ $str_out .= ' value="' . $t_option . '"> ' . $t_option .
+ ' ';
+ }
+ }
+ return $str_out;
+}
+
+/*
+ * function: build_cfield_radio_head
+ * support function useful for method used to write "radio head" CF values to db.
+ * Is normally called by _build_cfield()
+ *
+ * args: custom_field_value: value to be converted to be written to db.
+ *
+ * returns: value converted
+ *
+ *
+ */
+function build_cfield_radio_head($custom_field_value)
+{
+ if (count($value) > 1) {
+ $value = implode('|', $custom_field_value);
+ } else {
+ $value = is_array($custom_field_value) ? $custom_field_value[0] : $custom_field_value;
+ }
+ return $value;
+}
+?>
diff --git a/custom_config.inc.php.github.testlinkOauth.php b/custom_config.inc.php.github.testlinkOauth.php
index 5253129251..84d1aff379 100644
--- a/custom_config.inc.php.github.testlinkOauth.php
+++ b/custom_config.inc.php.github.testlinkOauth.php
@@ -1,30 +1,28 @@
-OAuthServers[2]['redirect_uri'] =
- 'http://fman.hopto.org/login.php?oauth=github';
-
-$tlCfg->OAuthServers[2]['oauth_client_id'] ='aa5f70a8de342fb95043';
-$tlCfg->OAuthServers[2]['oauth_client_secret'] =
- 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e';
-
-$tlCfg->OAuthServers[2]['oauth_enabled'] = true;
-$tlCfg->OAuthServers[2]['oauth_name'] = 'github';
-
-// Can be authorization_code (by default), client_credentials or password
-$tlCfg->OAuthServers[2]['oauth_grant_type'] = 'authorization_code';
-$tlCfg->OAuthServers[2]['oauth_url'] = 'https://github.com/login/oauth/authorize';
-
-$tlCfg->OAuthServers[2]['token_url'] = 'https://github.com/login/oauth/access_token';
-$tlCfg->OAuthServers[2]['oauth_force_single'] = false;
-$tlCfg->OAuthServers[2]['oauth_profile'] = 'https://api.github.com/user';
+OAuthServers[2]['redirect_uri'] = 'http://fman.hopto.org/login.php?oauth=github';
+
+$tlCfg->OAuthServers[2]['oauth_client_id'] = 'aa5f70a8de342fb95043';
+$tlCfg->OAuthServers[2]['oauth_client_secret'] = 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e';
+
+$tlCfg->OAuthServers[2]['oauth_enabled'] = true;
+$tlCfg->OAuthServers[2]['oauth_name'] = 'github';
+
+// Can be authorization_code (by default), client_credentials or password
+$tlCfg->OAuthServers[2]['oauth_grant_type'] = 'authorization_code';
+$tlCfg->OAuthServers[2]['oauth_url'] = 'https://github.com/login/oauth/authorize';
+
+$tlCfg->OAuthServers[2]['token_url'] = 'https://github.com/login/oauth/access_token';
+$tlCfg->OAuthServers[2]['oauth_force_single'] = false;
+$tlCfg->OAuthServers[2]['oauth_profile'] = 'https://api.github.com/user';
$tlCfg->OAuthServers[2]['oauth_scope'] = 'user:email';
-# End Of File
\ No newline at end of file
+
diff --git a/error.php b/error.php
index 032a9a8d90..469a6844da 100644
--- a/error.php
+++ b/error.php
@@ -1,64 +1,69 @@
-message = 'Rocket Raccoon is watching You';
- $code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0;
-
- switch($code) {
- case 1:
- $args->message = 'No CSRFName found, probable invalid request.';
- break;
-
- case 2:
- $args->message = 'Invalid CSRF token';
- break;
-
- default:
- break;
- }
-
- return $args;
-}
-
-/**
- *
- */
-function init_gui($args) {
- $gui = new stdClass();
- $gui->message = '';
-
- if (isset($args->message)) {
- $gui->message = $args->message;
- }
-
- return $gui;
-}
-
-$templateCfg = templateConfiguration();
-$args = init_args();
-$gui = init_gui($args);
-
-$smarty = new TLSmarty();
-$smarty->assign('gui', $gui);
-$smarty->display($templateCfg->default_template);
\ No newline at end of file
+message = 'Rocket Raccoon is watching You';
+ $code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0;
+
+ switch ($code) {
+ case 1:
+ $args->message = 'No CSRFName found, probable invalid request.';
+ break;
+
+ case 2:
+ $args->message = 'Invalid CSRF token';
+ break;
+
+ default:
+ break;
+ }
+
+ return $args;
+}
+
+/**
+ * initializes the GUI
+ *
+ * @param stdClass $args
+ * @return stdClass
+ */
+function init_gui($args)
+{
+ $gui = new stdClass();
+ $gui->message = '';
+
+ if (isset($args->message)) {
+ $gui->message = $args->message;
+ }
+
+ return $gui;
+}
+
+$templateCfg = templateConfiguration();
+$args = init_args();
+$gui = init_gui($args);
+
+$smarty = new TLSmarty();
+$smarty->assign('gui', $gui);
+$smarty->display($templateCfg->default_template);
diff --git a/firstLogin.php b/firstLogin.php
index af3489c6ef..2edd456f39 100644
--- a/firstLogin.php
+++ b/firstLogin.php
@@ -1,177 +1,213 @@
-assign('title', lang_get('fatal_page_title'));
- $smarty->assign('content', lang_get('error_self_signup_disabled'));
- $smarty->assign('link_to_op', "login.php");
- $smarty->assign('hint_text', lang_get('link_back_to_login'));
- $smarty->display('workAreaSimple.tpl');
- exit();
+assign('title', lang_get('fatal_page_title'));
+ $smarty->assign('content', lang_get('error_self_signup_disabled'));
+ $smarty->assign('link_to_op', "login.php");
+ $smarty->assign('hint_text', lang_get('link_back_to_login'));
+ $smarty->display('workAreaSimple.tpl');
+ exit();
+}
+doDBConnect($db, database::ONERROREXIT);
+
+$message = '';
+if (! is_null($args->doEditUser)) {
+ if (strcmp($args->password, $args->password2)) {
+ $message = lang_get('passwd_dont_match');
+ } else {
+ $user = new tlUser();
+ $rx = $user->checkPasswordQuality($args->password);
+ if ($rx['status_ok'] >= tl::OK) {
+ $result = $user->setPassword($args->password);
+ if ($result >= tl::OK) {
+ $user->login = $args->login;
+ $user->emailAddress = $args->email;
+ $user->firstName = $args->firstName;
+ $user->lastName = $args->lastName;
+ $result = $user->writeToDB($db);
+
+ $cfg = config_get('notifications');
+ if ($cfg->userSignUp->enabled) {
+ notifyGlobalAdmins($db, $user);
+ }
+ logAuditEvent(TLS("audit_users_self_signup", $args->login),
+ "CREATE", $user->dbID, "users");
+
+ $url2go = "login.php?note=first";
+ redirect(TL_BASE_HREF . $url2go);
+ exit();
+ } else {
+ $message = getUserErrorMessage($result);
+ }
+ } else {
+ $message = $rx['msg'];
+ }
+ }
+}
+
+$smarty = new TLSmarty();
+
+// we get info about THE DEFAULT AUTHENTICATION METHOD
+$gui->external_password_mgmt = tlUser::isPasswordMgtExternal();
+$gui->message = $message;
+$smarty->assign('gui', $gui);
+
+$tpl = str_replace('.php', '.tpl', basename($_SERVER['SCRIPT_NAME']));
+if ($args->viewer == 'new') {
+ $tpl = 'firstLogin-model-marcobiedermann.tpl';
+}
+$tpl = 'login/' . $tpl;
+$smarty->display($tpl);
+
+/**
+ * Get input from user and return it in some sort of namespace
+ *
+ * @return stdClass
+ */
+function init_args()
+{
+ $args = new stdClass();
+ $args->pwdInputSize = config_get('loginPagePasswordSize');
+
+ $iParams = array(
+ "doEditUser" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ 1
+ ),
+ "login" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ 30
+ ),
+ "password" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ $args->pwdInputSize
+ ),
+ "password2" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ $args->pwdInputSize
+ ),
+ "firstName" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ 30
+ ),
+ "lastName" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ 30
+ ),
+ "email" => array(
+ 'POST',
+ tlInputParameter::STRING_N,
+ 0,
+ 100
+ ),
+ "viewer" => array(
+ 'GET',
+ tlInputParameter::STRING_N,
+ 0,
+ 3
+ )
+ );
+ I_PARAMS($iParams, $args);
+
+ return $args;
+}
+
+/**
+ * send mail to administrators (users that have default role = administrator)
+ * to warn about new user created.
+ *
+ * @param database $dbHandler
+ * @param tlUser $userObj
+ */
+function notifyGlobalAdmins(&$dbHandler, &$userObj)
+{
+ // Get email addresses for all users that have default role = administrator
+ $cfg = config_get('notifications');
+ if (! is_null($cfg->userSignUp->to->roles)) {
+ $opt = array(
+ 'active' => 1
+ );
+ foreach ($cfg->userSignUp->to->roles as $roleID) {
+ $roleMgr = new tlRole($roleID);
+ $userSet = $roleMgr->getUsersWithGlobalRole($dbHandler, $opt);
+ $key2loop = array_keys($userSet);
+ foreach ($key2loop as $userID) {
+ if (! isset($mail['to'][$userID])) {
+ $mail['to'][$userID] = $userSet[$userID]->emailAddress;
+ }
+ }
+ }
+ }
+ if (! is_null($cfg->userSignUp->to->users)) {
+ // Brute force query
+ $tables = tlObject::getDBTables('users');
+ $sql = " SELECT id,email FROM {$tables['users']} " . " WHERE login IN('" .
+ implode("','", $cfg->userSignUp->to->users) . "')";
+ echo '| - {$labels.testplan_copy_user_roles} + {$labels.testplan_copy_user_roles} |
| - {$labels.testplan_copy_attachments} + {$labels.testplan_copy_attachments} |
| - + {$labels.testplan_copy_tcases} |
| - {$labels.testplan_copy_priorities} + {$labels.testplan_copy_priorities} |
| - + {$labels.testplan_copy_builds} |
| - {$labels.testplan_copy_platforms_links} + {$labels.copyPlatformsLinks} |
| - {$labels.testplan_copy_milestones} + {$labels.testplan_copy_milestones} |