From 3f4d6d50c829ce57414ede11c43937284ca7f573 Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Fri, 7 Jun 2024 19:43:12 +0000 Subject: [PATCH 1/2] Address additional numeric fields Allow zeroes in resource cost fields: as with the taxRate field, other numeric fields need to default to zero (0) rather than an empty string. Format zero as currency in cost tables: Empty values in the cost table are meant to be interpreted as a zero (0), formatted in the appropriate locale, rather than an empty string. Signed-off-by: Stephanie Leary Signed-off-by: Mike Rylander --- resources/ajax_processing/submitCost.php | 6 +++--- resources/directory.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/ajax_processing/submitCost.php b/resources/ajax_processing/submitCost.php index f0618efd4..89a5cf972 100644 --- a/resources/ajax_processing/submitCost.php +++ b/resources/ajax_processing/submitCost.php @@ -32,10 +32,10 @@ $resourcePayment->subscriptionStartDate = $start; $resourcePayment->subscriptionEndDate = $end; $resourcePayment->fundID = $fundIDArray[$key]; - $resourcePayment->priceTaxExcluded = $pteArray[$key]; + $resourcePayment->priceTaxExcluded = is_numeric($pteArray[$key]) ? $pteArray[$key] : null; $resourcePayment->taxRate = is_numeric($taxRateArray[$key]) ? $taxRateArray[$key] : null; - $resourcePayment->priceTaxIncluded = $ptiArray[$key]; - $resourcePayment->paymentAmount = $paymentAmountArray[$key]; + $resourcePayment->priceTaxIncluded = is_numeric($ptiArray[$key]) ? $ptiArray[$key] : null; + $resourcePayment->paymentAmount = is_numeric($paymentAmountArray[$key]) ? $paymentAmountArray[$key] : null; $resourcePayment->currencyCode = $currencyCodeArray[$key]; $resourcePayment->orderTypeID = $value; $resourcePayment->costDetailsID = $costDetailsArray[$key]; diff --git a/resources/directory.php b/resources/directory.php index ab27fb4b6..3a7f667e2 100644 --- a/resources/directory.php +++ b/resources/directory.php @@ -38,7 +38,7 @@ function integer_to_cost($price) { if ($price > 0){ return $nf->format($price / 100); }else{ - return ""; + return $nf->format(0); } } From 323dc2b502eba2e70d600d34a823de397b003dc1 Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Mon, 9 Sep 2024 16:47:52 +0000 Subject: [PATCH 2/2] Fix modal close issue in Resources > Accounts Corrects the function used to close the dialog for adding or editing resource accounts. Also adjusts the permissions of the sidebar navigation so that site admins are allowed to access the Accounts screen. Signed-off-by: Stephanie Leary Signed-off-by: Mike Rylander --- resources/directory.php | 2 +- resources/js/forms/externalLoginForm.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/directory.php b/resources/directory.php index 3a7f667e2..91b247018 100644 --- a/resources/directory.php +++ b/resources/directory.php @@ -90,7 +90,7 @@ function resource_sidemenu($selected_link = '') { } else { $class = 'sidemenuunselected'; } - if ($key != 'accounts' || $user->accountTabIndicator == '1') { + if ($key != 'accounts' || $user->accountTabIndicator == '1' || $user->isAdmin) { ?>
diff --git a/resources/js/forms/externalLoginForm.js b/resources/js/forms/externalLoginForm.js index 69dab5b51..60240aa4a 100644 --- a/resources/js/forms/externalLoginForm.js +++ b/resources/js/forms/externalLoginForm.js @@ -130,7 +130,7 @@ function submitExternalLogin(){ $("#span_errors").html(html); $("#submitExternalLoginForm").removeAttr("disabled"); }else{ - myDialogClose(); + myCloseDialog(); window.parent.updateAccounts(); return false; }