Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions gui/templates/inc_filter_panel.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
build,filter_tcID,filter_on,filter_result,status,
btn_update_menu,btn_apply_filter,keyword,keywords_filter_help,
filter_owner,TestPlan,test_plan,caption_nav_filters,
platform, include_unassigned_testcases, filter_active_inactive,
platform, filter_active_inactive,
btn_remove_all_tester_assignments, execution_type,
do_auto_update, testsuite, btn_reset_filters,hint_list_of_bugs,
btn_bulk_update_to_latest_version, priority, tc_title,
Expand Down Expand Up @@ -362,25 +362,13 @@
<select class="chosen-select" name="filter_assigned_user"
id="filter_assigned_user"
onchange="javascript: triggerAssignedBox('filter_assigned_user',
'filter_assigned_user_include_unassigned',
'{$control->option_strings.any}',
'{$control->option_strings.none}',
'{$control->option_strings.somebody}');">
{html_options options=$control->filters.filter_assigned_user.items
selected=$control->filters.filter_assigned_user.selected}
</select>

<br/>
<br />
<input type="checkbox"
id="filter_assigned_user_include_unassigned"
name="filter_assigned_user_include_unassigned"
value="1"
{if $control->filters.filter_assigned_user.filter_assigned_user_include_unassigned}
checked="checked"
{/if}
/>
{$labels.include_unassigned_testcases}
{/if}

</td>
Expand Down
14 changes: 2 additions & 12 deletions gui/templates/inc_filter_panel_js.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,15 @@
*
* @author Andreas Simon
* @param filter_assigned_to combobox in which assignment is chosen
* @param include_unassigned checkbox for including unassigned testcases
* @param str_option_any string value anybody
* @param str_option_none string value nobody
* @param str_option_somebody string value somebody
*/
function triggerAssignedBox(filter_assigned_to_id, include_unassigned_id,
str_option_any, str_option_none, str_option_somebody)
function triggerAssignedBox(filter_assigned_to_id, str_option_any, str_option_none, str_option_somebody)
{
var filter_assigned_to = document.getElementById(filter_assigned_to_id);
var include_unassigned = document.getElementById(include_unassigned_id);
var index = filter_assigned_to.options.selectedIndex;
var choice = filter_assigned_to.options[index].label;
include_unassigned.disabled = false;
if (choice == str_option_any || choice == str_option_none || choice == str_option_somebody)
{
include_unassigned.disabled = true;
include_unassigned.checked = false;
}
var choice = filter_assigned_to.options[index].label;
}
{/if}

Expand Down Expand Up @@ -146,7 +137,6 @@ function copy_tester_assignments_from_build(destination)

{if $control->filters.filter_assigned_user}
triggerAssignedBox('filter_assigned_user',
'filter_assigned_user_include_unassigned',
'{$control->option_strings.any}',
'{$control->option_strings.none}',
'{$control->option_strings.somebody}');
Expand Down
4 changes: 0 additions & 4 deletions lib/execute/execSetResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -2112,10 +2112,6 @@ function getSettingsAndFilters(&$argsObj)

$argsObj->refreshTree = isset($sf['setting_refresh_tree_on_action']) ?
$sf['setting_refresh_tree_on_action'] : null;

// Checkbox
$tgk = 'filter_assigned_user_include_unassigned';
$argsObj->include_unassigned = isset($sf[$tgk]) && ($sf[$tgk] != 0 ? 1 : 0);
}


Expand Down
2 changes: 0 additions & 2 deletions lib/functions/execTreeMenu.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ function initExecTree($filtersObj,$optionsObj)
$options['hideTestCases'] = isset($optionsObj->hideTestCases) ?
$optionsObj->hideTestCases : false;

$options['include_unassigned'] = isset($filtersObj->filter_assigned_user_include_unassigned) ?
$filtersObj->filter_assigned_user_include_unassigned : false;

// useful when using tree on set urgent test cases
$options['allow_empty_build'] = isset($optionsObj->allow_empty_build) ?
Expand Down
16 changes: 7 additions & 9 deletions lib/functions/testplan.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,21 +975,19 @@ function helper_assigned_to_sql($filter,$opt,$build_id)
" AND UA.type = {$this->execTaskCode} ";

// Warning!!!:
// If special user id TL_USER_NOBODY is present in set of user id
// we will ignore any other user id present on set.
// TL_USER_NOBODY is used to ask for unassigned testcases
$ff = (array)$filter;
$sql = " UA.user_id ";
if( in_array(TL_USER_NOBODY,$ff) )
if( in_array(TL_USER_SOMEBODY,$ff) )
{
$sql .= " IS NULL ";
$join = ' LEFT OUTER ' . $join;
}
else if( in_array(TL_USER_SOMEBODY,$ff) )
{
$sql .= " IS NOT NULL ";
$sql .= " IS NOT NULL ";
}
else
{
if( in_array(TL_USER_NOBODY,$ff) )
{
$opt['include_unassigned'] = true;
}
$sql_unassigned="";
$sql = '';
if( $opt['include_unassigned'] )
Expand Down
10 changes: 2 additions & 8 deletions lib/functions/tlTestCaseFilterByRequirementControl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,7 @@ public function get_argument_string()
// Using serialization
if ($this->active_filters['filter_assigned_user'])
{
$string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']) .
'&filter_assigned_user_include_unassigned=' .
($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0');
$string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']);
}

if ($this->active_filters['filter_result_result'])
Expand Down Expand Up @@ -1249,7 +1247,6 @@ private function init_filter_assigned_user()
}

$key = 'filter_assigned_user';
$unassigned_key = 'filter_assigned_user_include_unassigned';
$tplan_id = $this->settings['setting_testplan']['selected'];

// set selection to default (any), only change if value is sent by user and reset is not requested
Expand Down Expand Up @@ -1300,16 +1297,14 @@ private function init_filter_assigned_user()
}

$this->filters[$key] = array('items' => $visible_testers,
'selected' => $selection,
$unassigned_key => $this->args->{$unassigned_key});
'selected' => $selection);

// which value shall be passed to tree generation class?

if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection))
|| ($selection == TL_USER_ANYBODY)) {
// delete user assignment filter if "any user" is part of the selection
$this->active_filters[$key] = null;
$this->active_filters[$unassigned_key] = 0;
}

if (is_array($selection)) {
Expand All @@ -1318,7 +1313,6 @@ private function init_filter_assigned_user()
foreach ($this->active_filters[$key] as $user_key => $user_value) {
$this->active_filters[$key][$user_key] = $user_key;
}
$this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key];
}
} // end of method

Expand Down
35 changes: 12 additions & 23 deletions lib/functions/tlTestCaseFilterControl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
* [filter_result_result] => f // prefixed with "filter_" and "setting_"
* [filter_result_method] => 3
* [filter_result_build] => 71
* [filter_assigned_user_include_unassigned] => 1
* [filter_testcase_name] =>
* [filter_toplevel_testsuite] => Array
* (
Expand Down Expand Up @@ -486,9 +485,6 @@ protected function init_args()
$this->args->{$ek} = (isset($_REQUEST[$ek])) ? $_REQUEST[$ek] : null;
}

$this->args->{'filter_assigned_user_include_unassigned'} =
isset($_REQUEST['filter_assigned_user_include_unassigned']) ? 1 : 0;

// got session token sent by form or do we have to generate a new one?
$sent_token = null;
$this->args->form_token = null;
Expand Down Expand Up @@ -606,8 +602,7 @@ protected function init_filters()
// In resulting data structure, all values have to be defined (at least initialized),
// no matter wether they are wanted for filtering or not.
$dummy = array('filter_keywords_filter_type','filter_result_result',
'filter_result_method','filter_result_build',
'filter_assigned_user_include_unassigned');
'filter_result_method','filter_result_build');

foreach ($dummy as $filtername)
{
Expand Down Expand Up @@ -862,9 +857,7 @@ public function get_argument_string()
// Using serialization
if ($this->active_filters['filter_assigned_user'])
{
$string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']) .
'&filter_assigned_user_include_unassigned=' .
($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0');
$string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']);
}

if ($this->active_filters['filter_result_result'])
Expand Down Expand Up @@ -1753,7 +1746,6 @@ private function init_filter_assigned_user()
}

$key = 'filter_assigned_user';
$unassigned_key = 'filter_assigned_user_include_unassigned';
$tplan_id = $this->settings['setting_testplan']['selected'];

// set selection to default (any), only change if value is sent by user and reset is not requested
Expand Down Expand Up @@ -1791,38 +1783,35 @@ private function init_filter_assigned_user()
}

$view_mode = $simple ? $this->configuration->exec_cfg->view_mode->tester : 'all';

if ($view_mode != 'all') {
$visible_testers = (array)$this->user->getDisplayName();
$selection = (array)$this->user->dbID;
$visible_testers = array(TL_USER_NOBODY => $this->option_strings['none'],
$this->user->dbID => $this->user->getDisplayName());
if($selection == null){
$selection = (array)$this->user->dbID;
}
}

// re-enable option "user_filter_default"
if (!$selection && $this->configuration->exec_cfg->user_filter_default == 'logged_user') {
$selection = (array)$this->user->dbID;
}

}

$this->filters[$key] = array('items' => $visible_testers,
'selected' => $selection,
$unassigned_key => $this->args->{$unassigned_key});

'selected' => $selection);
// which value shall be passed to tree generation class?

if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection))
|| (is_array($selection) && in_array(TL_USER_NOBODY, $selection) && in_array(TL_USER_SOMEBODY, $selection))
|| ($selection == TL_USER_ANYBODY)) {
// delete user assignment filter if "any user" is part of the selection
// delete user assignment filter if "any user" is part of the selection or if SOMEBODY + NOBODY are selected
$this->active_filters[$key] = null;
$this->active_filters[$unassigned_key] = 0;
}

if (is_array($selection)) {
elseif (is_array($selection)) {
// get keys of the array as values
$this->active_filters[$key] = array_flip($selection);
foreach ($this->active_filters[$key] as $user_key => $user_value) {
$this->active_filters[$key][$user_key] = $user_key;
}
$this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key];
}
} // end of method

Expand Down
1 change: 0 additions & 1 deletion lib/testcases/tcSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
}
else
{
echo 'RRR';
$tproject_mgr->get_all_testcases_id($args->tprojectID,$a_tcid);

if(!is_null($a_tcid))
Expand Down
1 change: 1 addition & 0 deletions locale/en_GB/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,7 @@ $TLS_th_password = "Password";
$TLS_warning_empty_first_name = "Please enter a name";
$TLS_warning_empty_last_name = "Please enter a surname";
$TLS_warning_empty_login = "Please enter a login";
$TLS_expiration_date = "Expiration date";

// usersExport.php
$TLS_export_users = "Export users";
Expand Down
1 change: 1 addition & 0 deletions locale/fr_FR/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ $TLS_title_change_node_order = "Modifier l’ordre des éléments enfants";
// ----- gui/templates/containerView.tpl -----
$TLS_testsuite_operations = "Opérations sur les dossiers de tests";
$TLS_testcase_operations = "Opérations sur les fiches de test";
$TLS_testcase_version_operations = "Opérations sur les versions de la fiche de test";
$TLS_alt_del_testsuite = "Supprimer le dossier de tests avec tous les dossiers et fiches de test enfants";
$TLS_alt_edit_testsuite = "Modifier les données et titre du dossier de tests";
$TLS_alt_move_cp_testsuite = "Déplacer ou copier le dossier de tests vers un autre projet";
Expand Down