Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into prerelease #729

Merged
merged 7 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/src/Database/Type/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@ function pq($query, $args = array(), $upperCaseKeys = true)
{
if ($val !== null)
{
if (gettype($val) == gettype(0.1))
$val = round($val, 5);
$val = strval($val);
}
if ($upperCaseKeys)
Expand Down
9 changes: 5 additions & 4 deletions api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function _data_collections($single = null)
$where = " AND appm.autoprocprogrammessageid IS NOT NULL AND (appm.severity = 'WARNING' OR appm.severity = 'ERROR')";
$extj[0] .= "LEFT OUTER JOIN autoprocintegration api ON dc.datacollectionid = api.datacollectionid
LEFT OUTER JOIN processingjob pj ON dc.datacollectionid = pj.datacollectionid
LEFT OUTER JOIN autoprocprogram app ON (app.autoprocprogramid = api.autoprocprogramid OR dc.datacollectionid = pj.datacollectionid)
LEFT OUTER JOIN autoprocprogram app ON app.autoprocprogramid = api.autoprocprogramid
INNER JOIN autoprocprogrammessage appm ON appm.autoprocprogramid = app.autoprocprogramid";
} else if ($this->arg('t') == "scrystal" || $this->arg('t') == "nscrystal") {
// Single crystal or explicitly non-single-crystal fields
Expand Down Expand Up @@ -615,6 +615,7 @@ function _data_collections($single = null)
$groupby = "GROUP BY dc.datacollectiongroupid";
}

// We don't want to remove duplicates, since if two counts are equal, one might go uncounted
$total_query = "SELECT sum(tot) as t FROM (
$with
SELECT count($count_field) as tot
Expand All @@ -625,21 +626,21 @@ function _data_collections($single = null)
$extj[0]
WHERE $sess[0] $where

UNION SELECT count(es.energyscanid) as tot
UNION ALL SELECT count(es.energyscanid) as tot
FROM energyscan es
INNER JOIN blsession ses ON ses.sessionid = es.sessionid
$sample_joins[1]
$extj[1]
WHERE $sess[1] $where2

UNION SELECT count(xrf.xfefluorescencespectrumid) as tot
UNION ALL SELECT count(xrf.xfefluorescencespectrumid) as tot
FROM xfefluorescencespectrum xrf
INNER JOIN blsession ses ON ses.sessionid = xrf.sessionid
$sample_joins[3]
$extj[3]
WHERE $sess[3] $where4

UNION SELECT count(r.robotactionid) as tot
UNION ALL SELECT count(r.robotactionid) as tot
FROM robotaction r
INNER JOIN blsession ses ON ses.sessionid = r.blsessionid
$sample_joins[2]
Expand Down
4 changes: 2 additions & 2 deletions api/src/Page/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function _add_simple_sample()
$isCapillary = sizeof($crystals) > 1 ? true : false;

foreach ($crystals as $sample) {
$c = array('NAME' => $phase->ACRONYM . '-sample');
$c = $isCapillary ? array('NAME' => $sample->NAME) : array('NAME' => $phase->ACRONYM . '-sample');
foreach (array('SPACEGROUP', 'COMMENTS') as $f)
$c[$f] = array_key_exists($f, $sample) ? $sample->$f : '';
foreach (array('ABUNDANCE', 'THEORETICALDENSITY') as $f)
Expand Down Expand Up @@ -412,7 +412,7 @@ function _add_simple_sample()
if (array_key_exists('CAPILLARYID', $ids[$model]) && $capillary->CRYSTALID == null && !$capillary->CONTAINERLESS)
$blSamples['capillary'] = array('CONTAINERID' => $ids[$model]['CONTAINERID'], 'CRYSTALID' => $ids[$model]['CAPILLARYID'], 'PROTEINID' => $ids[$model]['CAPILLARYPHASEID'], 'LOCATION' => ++$maxLocation, 'NAME' => $capillary->NAME, 'PACKINGFRACTION' => 1, 'COMMENTS' => array_key_exists('COMMENTS', $capillary) ? $capillary->COMMENTS : '', 'DIMENSION1' => $capillary->OUTERDIAMETER, 'DIMENSION2' => $capillary->INNERDIAMETER, 'DIMENSION3' => $capillary->LENGTH, 'SHAPE' => $capillary->SHAPE, 'LOOPTYPE' => 1);

$blSamples['sample'] = array('CONTAINERID' => $ids[$model]['CONTAINERID'], 'CRYSTALID' => $ids[$model]['CRYSTALID'], 'PROTEINID' => $ids[$model]['PHASEID'], 'LOCATION' => ++$maxLocation, 'NAME' => $phase->ACRONYM, 'PACKINGFRACTION' => $attrs->PACKINGFRACTION ? $attrs->PACKINGFRACTION : null, 'COMMENTS' => array_key_exists('COMMENTS', $crystal) ? $crystal->COMMENTS : '');
$blSamples['sample'] = array('CONTAINERID' => $ids[$model]['CONTAINERID'], 'CRYSTALID' => $ids[$model]['CRYSTALID'], 'PROTEINID' => $ids[$model]['PHASEID'], 'LOCATION' => ++$maxLocation, 'NAME' => $crystal->NAME, 'PACKINGFRACTION' => $attrs->PACKINGFRACTION ? $attrs->PACKINGFRACTION : null, 'COMMENTS' => array_key_exists('COMMENTS', $crystal) ? $crystal->COMMENTS : '');

foreach ($blSamples as $key => $blSample) {
$a = $this->_prepare_sample_args($blSample);
Expand Down
4 changes: 2 additions & 2 deletions api/src/Page/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2685,10 +2685,10 @@ function _book_shipment_in_shipping_service($user, $shipment, $dewars, $journey_
"address_line3" => isset($address_lines[2]) ? $address_lines[2] : null,
"city" => $user["city"],
"country" => $user["country"],
"post_code" => rtrim($user["postcode"]),
"post_code" => trim($user["postcode"]),
"contact_name" => $user["name"],
"contact_phone_number" => $user["phone"],
"contact_email" => rtrim($user["email"])
"contact_email" => trim($user["email"])
);
$shipment_data = array(
"shipment_reference" => $shipment["PROP"],
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/app/layouts/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Main panel to store proposal menu, messages and content
Sets the main width of the content area on screen
-->
<div class="tw-w-full tw-px-2 lg:tw-w-10/12 lg:tw-mx-auto">
<div class="tw-w-full tw-px-2 lg:tw-w-11/12 lg:tw-mx-auto">
<navbar-menu
:proposal-menu="proposalMenu"
:extras-menu="extraMenu"
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/app/layouts/maintenance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class="tw-flex tw-justify-between tw-items-center tw-h-10 tw-bg-header-background"
/>

<div class="tw-w-10/12 tw-mx-auto">
<div class="tw-w-11/12 tw-mx-auto">
<!-- Sets the main width of the content on screen -->
<h1 class="tw-mt-4 tw-py-4 tw-text-xl">
The site is currently undergoing maintenance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
})

let crystal = new Crystal({
NAME: self.name,
NAME: item.acronym,
COMMENTS: item.comments,
THEORETICALDENSITY: item.density,
ABUNDANCE: 1
Expand Down Expand Up @@ -611,7 +611,7 @@
})

let crystal = new Crystal({
NAME: this.name,
NAME: this.acronym,
COMMENTS: this.comments,
THEORETICALDENSITY: this.density,
ABUNDANCE: 1
Expand Down
Loading