diff --git a/api/src/Page/DC.php b/api/src/Page/DC.php index b3e0d4d22..4ab4da7d2 100644 --- a/api/src/Page/DC.php +++ b/api/src/Page/DC.php @@ -1106,8 +1106,13 @@ function _chk_image() return; } + if (!$this->has_arg('pjid')) { + array_push($ids, $this->proposalid); + $where .= ' AND p.proposalid=:'.sizeof($ids); + } + $dct = $this->db->pq("SELECT CONCAT(p.proposalcode, p.proposalnumber, '-', s.visit_number) as vis, dc.datacollectionid as id, dc.startimagenumber, dc.filetemplate, dc.xtalsnapshotfullpath1 as x1, dc.xtalsnapshotfullpath2 as x2, dc.xtalsnapshotfullpath3 as x3, dc.xtalsnapshotfullpath4 as x4,dc.imageprefix as imp, dc.datacollectionnumber as run, dc.imagedirectory as dir, s.visit_number - FROM datacollection dc + FROM datacollection dc INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid INNER JOIN blsession s ON s.sessionid = dcg.sessionid INNER JOIN proposal p ON p.proposalid = s.proposalid WHERE $where", $ids); diff --git a/client/src/js/modules/dc/dclist.js b/client/src/js/modules/dc/dclist.js index 320f003ef..19ca15a94 100644 --- a/client/src/js/modules/dc/dclist.js +++ b/client/src/js/modules/dc/dclist.js @@ -1,6 +1,4 @@ define(['marionette', - //'modules/dc/views/imagestatuscollection', - //'modules/dc/views/apstatuscollection', 'modules/dc/collections/imagestatuses', 'modules/dc/collections/apstatuses', 'modules/dc/collections/apmessagestatuses', @@ -68,8 +66,16 @@ function(Marionette, }, _onSync: function() { - var ids = this.collection.pluck('ID') - this.imagestatuses.fetch({ data: { ids: ids }, type: 'POST' }) + var ids = this.collection + .filter(m => m.get('TYPE') === 'data' || m.get('TYPE') === 'grid') + .map(m => m.get('ID')); + var data = { ids: ids } + var params = this.getOption('params') || {}; + if (params.pjid != null) { + data.pjid = params.pjid + } + if (!ids.length) return + this.imagestatuses.fetch({ data: data, type: 'POST' }) if (this.getOption('apStatus')) this.apstatuses.fetch({ data: { ids: ids }, type: 'POST' }) if (this.getOption('apMessageStatus')) this.apmessagestatuses.fetch({ data: { ids: ids }, type: 'POST' }) }, diff --git a/client/src/js/modules/projects/views/view.js b/client/src/js/modules/projects/views/view.js index d510b29df..441da3e94 100644 --- a/client/src/js/modules/projects/views/view.js +++ b/client/src/js/modules/projects/views/view.js @@ -105,7 +105,7 @@ define(['marionette', edit.create('ACRONYM', 'text') } - this.dc.show(new DCView({ model: this.model, collection: this.dcs, params: { visit: null }, noPageUrl: true, noFilterUrl: true, noSearchUrl: true })) + this.dc.show(new DCView({ model: this.model, collection: this.dcs, params: { visit: null, pjid: this.model.get('PROJECTID') }, noPageUrl: true, noFilterUrl: true, noSearchUrl: true })) this.smp.show(new SampleList({ collection: this.samples, noPageUrl: true, noFilterUrl: true, noSearchUrl: true })) this.prt.show(new ProteinList({ collection: this.proteins, noPageUrl: true, noSearchUrl: true }))