-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Hide columns on list tasks #164
Closed
Closed
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3eb1f78
feat: Sortable table of tasks on Project page
Dane-2pi 209c7f8
feat: Table sorting
Dane-2pi a39c7df
Merge branch 'develop' into feature/SortProjectTasks
Dane-2pi ee74566
feat: 2198 Add hide columns to listtasks
Dane-2pi 75c5fdd
Merge branch 'feature/SortProjectTasks' of https://github.com/2pisoft…
Dane-2pi a9094de
fix: removing a redundant parameter to partial listtasks
Dane-2pi 4522dbe
fix: unecessary ternery
Dane-2pi f773dc5
fix codesniffer issues
Dane-2pi be60625
Merge branch 'develop' into feature/SortProjectTasks
adam-buckley ec9784b
Merge branch 'develop' into feature/SortProjectTasks
Dane-2pi 1d9f61d
Merge branch 'develop' into feature/SortProjectTasks
Dane-2pi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
<?php | ||
echo (empty($hide_filter) || $hide_filter !== true) ? Html::filter("Filter Tasks", $filter_data, '/' . $redirect, "GET", "Filter", "task_list") : ''; | ||
|
||
if (!empty($tasks)) { | ||
if (!empty($tasks)) | ||
{ | ||
$table_header = array("Title", "Created By", "Assigned To", "Group", "Type", "Priority", "Status", "Due"); | ||
$table_data = array(); | ||
if ($hide_columns) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per my comment above, this parameter is unnecessary because we can just check the existence of "columns_to_hide" to achieve the same effect. |
||
{ | ||
if (is_array($columns_to_hide)) | ||
{ | ||
$columns_to_hide = array_combine($columns_to_hide, $columns_to_hide); | ||
$table_header = array_diff_key($table_header, $columns_to_hide); | ||
} | ||
else | ||
{ | ||
$hide_columns = false; | ||
} | ||
} | ||
|
||
// Build table data | ||
usort($tasks, array("TaskService", "sortTasksbyDue")); | ||
foreach ($tasks as $task) { | ||
if ($task->getCanIView()) { | ||
foreach ($tasks as $task) | ||
{ | ||
if ($task->getCanIView()) | ||
{ | ||
$table_line = array(); | ||
$table_line[] = Html::a("/task/edit/" . $task->id, $task->title); | ||
|
||
|
@@ -23,12 +38,16 @@ | |
$task->isTaskLate() | ||
); | ||
|
||
if ($hide_columns) | ||
{ | ||
$table_line = array_diff_key($table_line, $columns_to_hide); | ||
} | ||
$table_data[] = $table_line; | ||
} | ||
} | ||
|
||
echo Html::table($table_data, null, "tablesorter", $table_header); | ||
|
||
} else { ?> | ||
} | ||
else | ||
{ ?> | ||
<h3><small>No tasks found.</small></h3> | ||
<?php } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all the brackets of the if statements on new lines? This doesn't match our code standard... maybe the code sniffer is configured wrong?