Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Emmanuel QUEVILLON
BIGSdb
Commits
decda6cf
Commit
decda6cf
authored
Jan 05, 2015
by
Keith Jolley
Browse files
Batch add isolates: Set sender to current user if submitter.
parent
c5938f62
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/BIGSdb/CurateBatchAddPage.pm
View file @
decda6cf
...
...
@@ -192,6 +192,12 @@ HTML
sub
_print_interface_sender_field
{
my
(
$self
)
=
@_
;
my
$q
=
$self
->
{'
cgi
'};
my
$user_info
=
$self
->
{'
datastore
'}
->
get_user_info_from_username
(
$self
->
{'
username
'}
);
if
(
$user_info
->
{'
status
'}
eq
'
submitter
'
)
{
say
$q
->
hidden
(
sender
=>
$user_info
->
{'
id
'});
return
;
}
my
$qry
=
"
select id,user_name,first_name,surname from users WHERE id>0 order by surname
";
my
$sql
=
$self
->
{'
db
'}
->
prepare
(
$qry
);
eval
{
$sql
->
execute
};
...
...
@@ -206,7 +212,7 @@ sub _print_interface_sender_field {
}
say
"
<div style=
\"
margin-bottom:1em
\"
><p>Please select the sender from the list below:</p>
";
$usernames
{
-
1
}
=
'
Override with sender field
';
say
$
self
->
{'
cgi
'}
->
popup_menu
(
-
name
=>
'
sender
',
-
values
=>
[
'',
-
1
,
@users
],
-
labels
=>
\
%usernames
);
say
$
q
->
popup_menu
(
-
name
=>
'
sender
',
-
values
=>
[
'',
-
1
,
@users
],
-
labels
=>
\
%usernames
);
say
"
<span class=
\"
comment
\"
> Value will be overridden if you include a sender field in your pasted data.</span>
";
say
"
</div>
";
return
;
...
...
lib/BIGSdb/CurateBatchIsolateUpdatePage.pm
View file @
decda6cf
...
...
@@ -151,6 +151,8 @@ sub _check {
my
$q
=
$self
->
{'
cgi
'};
my
$data
=
$q
->
param
('
data
');
my
@rows
=
split
/\n/
,
$data
;
#TODO Prevent submitter from changing sender to anyone outside the usergroup.
if
(
@rows
<
2
)
{
say
qq(<div class="box" id="statusbad"><p>Nothing entered. Make sure you include a header line.</p>)
;
say
qq(<p><a href="$self->{'system'}->{'script_name'}?db=$self->{'instance'}&page=batchIsolateUpdate">Back</a></p></div>)
;
...
...
@@ -405,7 +407,7 @@ sub _update {
my
$match
=
$self
->
_get_match_criteria
;
my
$view
=
$self
->
{'
system
'}
->
{'
view
'};
foreach
my
$record
(
@records
)
{
foreach
my
$record
(
@records
)
{
my
(
$id1
,
$id2
,
$field
,
$value
)
=
@$record
;
my
(
$isolate_id
,
$old_value
);
$nochange
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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