Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
ng6
Commits
618b7824
Commit
618b7824
authored
Sep 28, 2016
by
Claire Kuchly
Browse files
update administration run and analyze passed retention date
parent
fd11764e
Changes
5
Hide whitespace changes
Inline
Side-by-side
bin/ng6_database.sql
View file @
618b7824
...
...
@@ -1082,34 +1082,6 @@ CREATE TABLE IF NOT EXISTS `tx_nG6_analyze_comment` (
KEY
`parent`
(
`pid`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
CREATE
OR
REPLACE
VIEW
`tx_nG6_view_project_run`
AS
SELECT
tx_nG6_project
.
uid
AS
project_id
,
tx_nG6_project
.
name
AS
project_name
,
tx_nG6_run
.
uid
AS
run_id
,
tx_nG6_run
.
storage_size
AS
storage_size
,
tx_nG6_run
.
purged_size
AS
purged_size
,
tx_nG6_run
.
data_state
AS
state
,
tx_nG6_run
.
retention_date
AS
retention_date
FROM
tx_nG6_run
INNER
JOIN
tx_nG6_project_run
ON
tx_nG6_project_run
.
run_id
=
tx_nG6_run
.
uid
INNER
JOIN
tx_nG6_project
ON
tx_nG6_project
.
uid
=
tx_nG6_project_run
.
project_id
CREATE
OR
REPLACE
VIEW
tx_nG6_view_project_run_analyze
AS
SELECT
tx_nG6_project
.
uid
AS
project_id
,
tx_nG6_project
.
name
AS
project_name
,
tx_nG6_analyze
.
uid
AS
analyze_id
,
tx_nG6_analyze
.
storage_size
AS
storage_size
,
tx_nG6_analyze
.
purged_size
AS
purged_size
,
tx_nG6_analyze
.
data_state
AS
state
,
tx_nG6_analyze
.
retention_date
AS
retention_date
FROM
tx_nG6_run
INNER
JOIN
tx_nG6_project_run
ON
tx_nG6_project_run
.
run_id
=
tx_nG6_run
.
uid
INNER
JOIN
tx_nG6_project
ON
tx_nG6_project
.
uid
=
tx_nG6_project_run
.
project_id
INNER
JOIN
tx_nG6_run_analyze
ON
tx_nG6_run_analyze
.
run_id
=
tx_nG6_run
.
uid
INNER
JOIN
tx_nG6_analyze
ON
tx_nG6_run_analyze
.
analyze_id
=
tx_nG6_analyze
.
uid
CREATE
OR
REPLACE
VIEW
tx_nG6_view_project_analyze
AS
SELECT
tx_nG6_project
.
uid
AS
project_id
,
tx_nG6_project
.
name
AS
project_name
,
tx_nG6_analyze
.
uid
AS
analyze_id
,
tx_nG6_analyze
.
storage_size
AS
storage_size
,
tx_nG6_analyze
.
purged_size
AS
purged_size
,
tx_nG6_analyze
.
data_state
AS
state
,
tx_nG6_analyze
.
retention_date
AS
retention_date
FROM
tx_nG6_project
INNER
JOIN
tx_nG6_project_analyze
ON
tx_nG6_project_analyze
.
project_id
=
tx_nG6_project
.
uid
INNER
JOIN
tx_nG6_analyze
ON
tx_nG6_project_analyze
.
analyze_id
=
tx_nG6_analyze
.
uid
CREATE
OR
REPLACE
VIEW
tx_nG6_view_project_user
AS
SELECT
tx_nG6_project
.
uid
AS
project_id
,
fe_users
.
username
AS
user_name
,
fe_users
.
email
AS
email
,
fe_users
.
usergroup
AS
user_group
,
fe_rights_levels
.
right_level_label
AS
right_level_label
FROM
tx_nG6_project
INNER
JOIN
fe_rights
ON
fe_rights
.
project_id
=
tx_nG6_project
.
uid
INNER
JOIN
fe_users
ON
fe_rights
.
fe_user_id
=
fe_users
.
uid
INNER
JOIN
fe_groups
ON
fe_users
.
usergroup
=
fe_groups
.
uid
INNER
JOIN
fe_rights_levels
ON
fe_rights_levels
.
right_level_id
=
fe_rights
.
right_id
CREATE
TABLE
IF
NOT
EXISTS
`tx_rsaauth_keys`
(
`uid`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`pid`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
...
...
src/ng6/t3MySQLdb.py
View file @
618b7824
...
...
@@ -302,11 +302,11 @@ class t3MySQLdb(object):
crdate
=
str
(
time
.
mktime
(
datetime
.
date
.
today
().
timetuple
())).
split
(
"."
)[
0
]
retention_date
=
time
.
mktime
((
datetime
.
date
.
today
()
+
datetime
.
timedelta
(
days
=
365
*
int
(
self
.
cfg_reader
.
get_retention_time
()))).
timetuple
())
sql
=
"INSERT INTO tx_nG6_run (pid, tstamp, crdate, cruser_id, name, date, directory, species, data_nature,
\
type, nb_sequences, full_seq_size, description, hidden, sequencer, retention_date, data_state) VALUES ('%s', '%s', '%s', %s, '%s', '%s','%s',
\
'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')"
%
(
self
.
cfg_reader
.
get_pid
(),
crdate
,
crdate
,
cruser_id
,
self
.
esc_q
(
name
),
type, nb_sequences, full_seq_size, description, hidden, sequencer, retention_date, data_state
, purged_date, purged_size, mail_sent_date
) VALUES ('%s', '%s', '%s', %s, '%s', '%s','%s',
\
'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',
'%s', '%s', '%s',
'%s')"
%
(
self
.
cfg_reader
.
get_pid
(),
crdate
,
crdate
,
cruser_id
,
self
.
esc_q
(
name
),
time
.
mktime
(
date
.
timetuple
()),
directory
,
self
.
esc_q
(
species
),
self
.
esc_q
(
data_nature
),
self
.
esc_q
(
type
),
nb_sequences
,
full_seq_size
,
self
.
esc_q
(
description
),
hidden
,
self
.
esc_q
(
sequencer
),
retention_date
,
"stored"
)
full_seq_size
,
self
.
esc_q
(
description
),
hidden
,
self
.
esc_q
(
sequencer
),
retention_date
,
"stored"
,
"0"
,
"0"
,
"0"
)
qresult
=
self
.
execute
(
sql
,
commit
=
True
)
run_id
=
qresult
.
lastrowid
...
...
@@ -684,12 +684,12 @@ class t3MySQLdb(object):
sql
=
"INSERT INTO tx_nG6_analyze (pid, tstamp, crdate, cruser_id, class, name,
\
description, date, directory, software, version,
\
hidden, params, is_editable, parent_uid, retention_date, data_state)
\
hidden, params, is_editable, parent_uid, retention_date, data_state
, purged_date, purged_size, mail_sent_date
)
\
VALUES ('%s', '%s', '%s', %s, '%s','%s', '%s',
\
'%s', '%s', '%s', '%s', '%s', '%s' ,'%s', '%s', '%s', '%s')"
%
(
self
.
cfg_reader
.
get_pid
(),
crdate
,
crdate
,
cruser_id
,
aclass
,
'%s', '%s', '%s', '%s', '%s', '%s' ,'%s', '%s', '%s',
'%s', '%s', '%s',
'%s')"
%
(
self
.
cfg_reader
.
get_pid
(),
crdate
,
crdate
,
cruser_id
,
aclass
,
self
.
esc_q
(
name
),
self
.
esc_q
(
description
),
crdate
,
directory
,
self
.
esc_q
(
software
),
self
.
esc_q
(
version
),
hidden
,
self
.
esc_q
(
params
),
analysis_is_editable
,
parent_uid
,
retention_date
,
"stored"
)
hidden
,
self
.
esc_q
(
params
),
analysis_is_editable
,
parent_uid
,
retention_date
,
"stored"
,
"0"
,
"0"
,
"0"
)
qresult
=
self
.
execute
(
sql
,
commit
=
True
)
analysis_id
=
qresult
.
lastrowid
...
...
ui/nG6/class.tx_nG6_eid.php
View file @
618b7824
...
...
@@ -805,6 +805,7 @@ class tx_nG6_eid {
$cumulate
=
true
;
}
print
json_encode
(
tx_nG6_db
::
select_projects_evolution
(
$values
,
$by
,
$role
,
$cumulate
));
}
elseif
(
$type
==
'data_distribution'
){
$values
=
split
(
","
,
trim
(
t3lib_div
::
_GP
(
'values'
)));
$by
=
trim
(
t3lib_div
::
_GP
(
'by'
));
...
...
@@ -818,6 +819,7 @@ class tx_nG6_eid {
$octet
=
false
;
}
print
json_encode
(
tx_nG6_db
::
select_storage_distribution
(
$values
,
$by
,
$role
,
$get_analyzes
,
$octet
));
}
elseif
(
$type
==
'data_evolution'
){
$values
=
split
(
","
,
trim
(
t3lib_div
::
_GP
(
'values'
)));
$by
=
trim
(
t3lib_div
::
_GP
(
'by'
));
...
...
@@ -835,6 +837,7 @@ class tx_nG6_eid {
$cumulate
=
true
;
}
print
json_encode
(
tx_nG6_db
::
select_storage_evolution
(
$values
,
$by
,
$role
,
$get_analyzes
,
$octet
,
$cumulate
));
}
elseif
(
$type
==
'purge_managment_mail'
)
{
$all_analyses
=
trim
(
t3lib_div
::
_GP
(
'all_analyses'
));
$all_runs
=
trim
(
t3lib_div
::
_GP
(
'all_runs'
));
...
...
ui/nG6/pi6/administration_view.tpl
View file @
618b7824
...
...
@@ -416,7 +416,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div
class=
"btn-group"
>
<button
id=
"mail_sent"
type=
"button"
class=
"btn btn-sm btn-default"
><i
class=
"glyphicon glyphicon-envelope"
></i>
Mark as mail sent
</button>
<button
id=
"retention_change"
type=
"button"
class=
"btn btn-sm btn-default"
><i
class=
"glyphicon glyphicon-refresh"
></i>
Change retention date
</button>
<button
id=
"purge"
type=
"button"
class=
"btn btn-sm btn-default"
><i
class=
"glyphicon glyphicon-
minus
"
></i>
purge data
</button>
<button
id=
"purge
_data_list
"
type=
"button"
class=
"btn btn-sm btn-default"
><i
class=
"glyphicon glyphicon-
save
"
></i>
Get
purge data
list
</button>
</div>
</th>
</tr>
...
...
ui/nG6/res/js/tx_nG6_pi6.js
View file @
618b7824
...
...
@@ -493,8 +493,8 @@ $(function () {
});
});
//change retention date
//change retention date
$
(
"
#retention_change
"
).
click
(
function
(){
var
all_runs
=
""
,
...
...
@@ -542,10 +542,48 @@ $(function () {
});
});
//return list of run and analyze to purge
$
(
"
#purge_data_list
"
).
click
(
function
(){
var
all_runs
=
""
,
all_analyses
=
""
;
$
(
'
:checked[id^=chk_col
'
).
each
(
function
(){
col_name
=
$
(
this
).
val
();
$
(
'
:checked[id^=chk_project
'
).
each
(
function
(){
project_id
=
$
(
this
).
val
();
if
(
col_name
.
startsWith
(
"
r
"
)
){
cur_run
=
$
(
'
input[id=
'
+
col_name
+
"
_
"
+
project_id
+
'
]
'
).
attr
(
"
values
"
);
if
(
cur_run
!=
""
){
all_runs
+=
cur_run
+
"
,
"
;
}
}
else
{
cur_analyse
=
$
(
'
input[id=
'
+
col_name
+
"
_
"
+
project_id
+
'
]
'
).
attr
(
"
values
"
);
if
(
cur_analyse
!=
""
){
all_analyses
+=
cur_analyse
+
"
,
"
;
}
}
});
});
date_send
=
$
(
"
#change_retention_date
"
).
val
();
$
.
ajax
({
url
:
"
index.php?eID=tx_nG6&type=get_data_list&all_analyses=
"
+
all_analyses
+
"
&all_runs=
"
+
all_runs
,
dataType
:
'
json
'
,
success
:
function
(
val
,
status
,
xhr
)
{
all_analyses
;
console
.
log
(
val
);
}
});
});
});
function
set_active_tab
(
active_tab
){
if
(
!
endsWith
(
window
.
location
.
href
,
"
active_tab=
"
+
active_tab
))
{
window
.
location
.
assign
(
window
.
location
.
href
+
"
&active_tab=
"
+
active_tab
);
...
...
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