Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
acb642e7
Commit
acb642e7
authored
Jan 11, 2018
by
Celine Noirot
Browse files
add with lab implie
parent
24737ffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
ui/nG6/lib/class.tx_nG6_db.php
View file @
acb642e7
...
...
@@ -91,16 +91,17 @@ class tx_nG6_db {
}
function
get_project_list_by_group_filter
(
$create_user_id
,
$
user
_group_id
){
$where
=
""
;
function
get_project_list_by_group_filter
(
$create_user_id
,
$
without_group_id
,
$with
_group_id
){
$where
=
Array
()
;
$list_project_id_filter_by_group
=
""
;
$list_project_id_laboratories
=
""
;
if
(
$user_group_id
!=
""
){
### Search for project without group_id implied
if
(
$without_group_id
!=
""
){
#select all project_id with group OR/AND without group
$queryParts
=
array
(
'SELECT'
=>
'project_id'
,
'FROM'
=>
'tx_nG6_view_project_user'
,
'WHERE'
=>
'user_group IN ( '
.
$
user
_group_id
.
')'
,
'WHERE'
=>
'user_group IN ( '
.
$
without
_group_id
.
')'
,
'GROUPBY'
=>
''
,
'ORDERBY'
=>
''
,
'LIMIT'
=>
''
...
...
@@ -114,21 +115,38 @@ class tx_nG6_db {
$list_project_id_filter_by_group
=
$res_row
[
'project_id'
];
}
}
$where
.
=
"uid NOT IN ("
.
$list_project_id_filter_by_group
.
")"
;
$where
[]
=
"uid NOT IN ("
.
$list_project_id_filter_by_group
.
")"
;
}
if
(
$create_user_id
!=
""
){
if
(
$where
!=
""
){
$where
.
=
" AND cruser_id IN ("
.
$create_user_id
.
")"
;
}
else
{
$where
.
=
"cruser_id IN ("
.
$create_user_id
.
")"
;
### Search for project with group_id implied
if
(
$with_group_id
!=
""
){
#select all project_id with group OR/AND without group
$queryParts
=
array
(
'SELECT'
=>
'project_id'
,
'FROM'
=>
'tx_nG6_view_project_user'
,
'WHERE'
=>
'user_group IN ( '
.
$with_group_id
.
')'
,
'GROUPBY'
=>
''
,
'ORDERBY'
=>
''
,
'LIMIT'
=>
''
);
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_SELECT_queryArray
(
$queryParts
);
while
(
$res_row
=
$GLOBALS
[
'TYPO3_DB'
]
->
sql_fetch_assoc
(
$res
))
{
if
(
$list_project_id_filter_by_group
!=
""
){
$list_project_id_filter_by_group
.
=
","
.
$res_row
[
'project_id'
];
}
else
{
$list_project_id_filter_by_group
=
$res_row
[
'project_id'
];
}
}
$where
[]
=
"uid IN ("
.
$list_project_id_filter_by_group
.
")"
;
}
### add create user filter
if
(
$create_user_id
!=
""
){
$where
[]
=
"cruser_id IN ("
.
$create_user_id
.
")"
;
}
$queryParts
=
array
(
'SELECT'
=>
'uid AS project_id'
,
'FROM'
=>
'tx_nG6_project'
,
'WHERE'
=>
$where
,
'WHERE'
=>
join
(
' AND '
,
$where
)
,
'GROUPBY'
=>
''
,
'ORDERBY'
=>
''
,
'LIMIT'
=>
''
...
...
@@ -151,7 +169,7 @@ class tx_nG6_db {
# OBSOLETE / PURGE management
################################
function
filter_list_retention_data_info
(
$filter_size
,
$max_retention_date
,
$create_user_id
,
$user_group_id
)
{
function
filter_list_retention_data_info
(
$filter_size
,
$max_retention_date
,
$create_user_id
,
$
without_user_group_id
,
$with_
user_group_id
)
{
$where
=
' DATEDIFF( FROM_UNIXTIME( retention_date ) , now( ) ) <0'
;
$where
.
=
' AND purge_demand_id IS NULL '
;
$where
.
=
' AND state IN ( \'stored\', \'extended\') '
;
...
...
@@ -163,8 +181,9 @@ class tx_nG6_db {
}
$project_list_ids
=
""
;
if
(
$create_user_id
!=
""
or
$user_group_id
!=
""
)
{
$project_list_ids
=
tx_nG6_db
::
get_project_list_by_group_filter
(
$create_user_id
,
$user_group_id
);
if
(
$create_user_id
!=
""
or
$without_user_group_id
!=
""
or
$with_user_group_id
!=
""
)
{
#retrieve list of project id created by a user and with or without a list of group_id
$project_list_ids
=
tx_nG6_db
::
get_project_list_by_group_filter
(
$create_user_id
,
$without_user_group_id
,
$with_user_group_id
);
$where
.
=
" AND project_id in ("
.
$project_list_ids
.
")"
;
}
return
(
tx_nG6_db
::
select_list_retention_data_info
(
$where
));
...
...
ui/nG6/pi6/administration_view.tpl
View file @
acb642e7
...
...
@@ -322,17 +322,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div
class=
"col-sm-6"
>
<fieldset
class=
"col-sm-12"
>
<h4>
4.
Without l
aboratories implie
?
</h4>
<h4>
4.
L
aboratories implie
:
</h4>
<div
id=
"wrapper_datatable_laboratories"
>
<table
class=
"table table-striped table-bordered dataTable"
id=
"data_table_select_lab"
>
<thead>
<th></th>
<th>
With
</th>
<th>
Without
</th>
<th>
Laboratories
</th>
</thead>
<tbody>
{
foreach
$distribution
key
=
group_name
item
=
group_values
}
<tr>
<td><center><input
type=
"checkbox"
class=
"chk_without_lab_element"
value=
"
{
$group_values.group_id
}
"
></center></td>
<td><center><input
type=
"checkbox"
class=
"chk_with_lab_element"
name=
"group_
{
$group_values.group_id
}
"
value=
"
{
$group_values.group_id
}
"
></center></td>
<td><center><input
type=
"checkbox"
class=
"chk_without_lab_element"
name=
"group_
{
$group_values.group_id
}
"
value=
"
{
$group_values.group_id
}
"
></center></td>
<td>
{
$group_name
}
</td>
</tr>
{/
foreach
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment