Skip to content

Commit

Permalink
LIMS-1011: Allow linking of registered dewars to proposals without a …
Browse files Browse the repository at this point in the history
…lab contact
  • Loading branch information
Mark Williams committed Dec 4, 2023
1 parent ff3e520 commit 6382705
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/src/Page/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,7 @@ function _add_prop_dewar()
$this->_error('No dewar specified');
if (!$this->has_arg('PROPOSALID'))
$this->_error('No proposal specified');
if (!$this->has_arg('LABCONTACTID'))
$this->_error('No lab contact specified');
$lc = $this->has_arg('LABCONTACTID') ? $this->arg('LABCONTACTID') : null;

$chk = $this->db->pq("SELECT dewarregistryid
FROM dewarregistry_has_proposal
Expand All @@ -739,7 +738,7 @@ function _add_prop_dewar()
$this->_error('That dewar is already registered to that proposal');

$this->db->pq("INSERT INTO dewarregistry_has_proposal (dewarregistryid,proposalid,personid,labcontactid)
VALUES (:1,:2,:3,:4)", array($this->arg('DEWARREGISTRYID'), $this->arg('PROPOSALID'), $this->user->personId, $this->arg('LABCONTACTID')));
VALUES (:1,:2,:3,:4)", array($this->arg('DEWARREGISTRYID'), $this->arg('PROPOSALID'), $this->user->personId, $lc));

$this->_output(array('DEWARREGISTRYHASPROPOSALID' => $this->db->id()));
}
Expand Down

0 comments on commit 6382705

Please sign in to comment.