Permalink
Browse files

Merge branch 'develop' of https://github.com/MG-RAST/MG-RAST into dev…

…elop
  • Loading branch information...
2 parents d3ebcc1 + bcbd707 commit 5f9979e8805770a1604338ed6db545070ee2b818 @jaredbischof jaredbischof committed Mar 1, 2013
Showing with 10 additions and 7 deletions.
  1. +1 −0 src/MGRAST/lib/Analysis.pm
  2. +9 −7 src/MGRAST/lib/resources2/metagenome.pm
@@ -1678,6 +1678,7 @@ sub get_md5_data {
$cache_key .= defined($eval) ? $eval : ":";
$cache_key .= defined($ident) ? $ident : ":";
$cache_key .= defined($alen) ? $alen : ":";
+ $cache_key .= $rep_org_src ? $rep_org_src : ":";
my $data = {};
my $jobs = [];
@@ -156,17 +156,19 @@ sub query {
}
# get all items the user has access to
- my $status = $self->cgi->param('status') || "both";
- my $mglist = [];
+ my $status = $self->cgi->param('status') || "both";
+ my %public = map { $_, 1 } @{ $master->Job->get_public_jobs(1) };
+ my %private = map { $_, 1 } grep { ! exists($public{$_}) } keys %{ $self->rights };
+ my @mglist = ();
if ($status eq 'private') {
- @$mglist = keys %{$self->rights};
+ @mglist = keys %private;
} elsif ($status eq 'public') {
- $mglist = $master->Job->get_public_jobs(1);
+ @mglist = keys %public;
} else {
- @$mglist = ( @{$master->Job->get_public_jobs(1)}, keys %{$self->rights} );
+ @mglist = ( keys %private, keys %public );
}
- my $total = scalar(@$mglist);
- my $mgstr = join(',', grep {$_ ne '*'} @$mglist);
+ my $total = scalar(@mglist);
+ my $mgstr = join(',', grep {$_ ne '*'} @mglist);
my $jobs = $master->Job->get_objects( {$order => [undef, "viewable=1 AND metagenome_id IN ($mgstr) ORDER BY $order LIMIT $limit OFFSET $offset"]} );
$limit = ($limit > scalar(@$jobs)) ? scalar(@$jobs) : $limit;

0 comments on commit 5f9979e

Please sign in to comment.