Skip to content

Commit

Permalink
LIMS-705: Ignore null visits (#586)
Browse files Browse the repository at this point in the history
* LIMS-705: Ignore null visits

* LIMS-705: Add a new parameter to specify non-null visits

---------

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
  • Loading branch information
ndg63276 and Mark Williams authored Aug 25, 2023
1 parent 668fc94 commit ff6217e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/src/Page/Proposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Proposal extends Page
'started' => '\d',
'scheduled' => '\d',
'current' => '\d',
'notnull' => '\d+',

'COMMENTS' => '(\w|\s|-)+',

Expand Down Expand Up @@ -340,6 +341,10 @@ function _get_visits($visit = null, $output = true)
$where = 'WHERE s.proposalid = :1';
}

if ($this->has_arg('notnull')) {
$where .= ' AND s.visit_number is not NULL';
}

if ($this->has_arg('year')) {
$where .= " AND TO_CHAR(s.startdate, 'YYYY') = :" . (sizeof($args) + 1);
array_push($args, $this->arg('year'));
Expand Down
1 change: 1 addition & 0 deletions client/src/js/modules/shipment/views/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ define(['marionette', 'views/form',

var self = this
this.visits = new VVisits(null, { state: { pageSize: 9999 } })
this.visits.queryParams.notnull = 1
this.ready = []
this.ready.push(this.visits.fetch())

Expand Down

0 comments on commit ff6217e

Please sign in to comment.