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

Add platform parameter to SUSHI Services in Usage Module #701

Merged
merged 1 commit into from
Jun 17, 2022
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
11 changes: 11 additions & 0 deletions auth/install/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,17 @@ function register_auth_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Auth Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
4 changes: 2 additions & 2 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
*
* NOTE: It is assumed that version strings can be understood by php's version_compare function
*/
$INSTALLATION_VERSION = "2020.09";
$INSTALLATION_VERSIONS = ["1.9.0", "2.0.0", "3.0.0", "3.0.1", "2020.02", "2020.09"];
$INSTALLATION_VERSION = "2022.04";
$INSTALLATION_VERSIONS = ["1.9.0", "2.0.0", "3.0.0", "3.0.1", "2020.02", "2020.09", "2022.04"];

function make_sure_template_is_drawn()
{
Expand Down
11 changes: 11 additions & 0 deletions licensing/install/licensing.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ function register_licensing_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Licensing Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
11 changes: 11 additions & 0 deletions management/install/management.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ function register_management_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Management Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
11 changes: 11 additions & 0 deletions organizations/install/organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ function register_organizations_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Organizations Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
11 changes: 11 additions & 0 deletions reports/install/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ function register_reports_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Reports Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
11 changes: 11 additions & 0 deletions resources/install/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,17 @@ function register_resources_provider()
];

case "2020.09":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Resources Module");
return $return;
}
];

case "2022.04":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
4 changes: 4 additions & 0 deletions usage/admin/classes/domain/SushiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ private function jsonTransfer($reportLayout, $serviceProvider)
$params['include_parent_details'] = 'true';
}

if ($this->platform) {
$params['platform'] = $this->platform;
}

// setup curl client
$trailingSlash = substr($this->serviceURL, -1) == '/' ? '' : '/';
$endpoint = $this->serviceURL . $trailingSlash . 'reports/' . strtolower($reportLayout) . '?' . http_build_query($params);
Expand Down
5 changes: 5 additions & 0 deletions usage/ajax_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@
<td style='vertical-align:top;text-align:right;width:135px;'><label for='customerID'><b><?php echo _("Customer ID:");?></b></label></td>
<td><input type='text' id='customerID' name='customerID' value="<?php if ($sushiServiceID) echo $sushiService->customerID; ?>" style='width:330px;' /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='platform'><b><?php echo _("Platform:");?></b></label></td>
<td><input type='text' id='platform' name='platform' value="<?php if ($sushiServiceID) echo $sushiService->platform; ?>" style='width:330px;' />
<span class="smallDarkRedText"><?php echo _("(optional)") . " " . _("only needed when required by vendor");?></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='security'><b><?php echo _("Security Type:");?></b></label></td>
<td><input type='text' id='security' name='security' value="<?php if ($sushiServiceID) echo $sushiService->security; ?>" style='width:150px;' />
Expand Down
1 change: 1 addition & 0 deletions usage/ajax_htmldata.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
echo "<tr><td>" . _("Requestor ID") . "</td><td>" . $sushiService->requestorID . "</td></tr>";
echo "<tr><td>" . _("API Key") . "</td><td>" . $sushiService->apiKey . "</td></tr>";
echo "<tr><td>" . _("Customer ID") . "</td><td>" . $sushiService->customerID . "</td></tr>";
echo "<tr><td>" . _("Platform") . "</td><td>" . $sushiService->platform . "</td></tr>";
echo "<tr><td>" . _("Security") . "</td><td>" . $sushiService->security . "</td></tr>";
echo "<tr><td>" . _("Login") . "</td><td>" . $sushiService->login . "</td></tr>";
echo "<tr><td>" . _("Password") . "</td><td>" . $sushiService->password . "</td></tr>";
Expand Down
1 change: 1 addition & 0 deletions usage/ajax_processing.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
$sushiService->requestorID = $_POST['requestorID'];
$sushiService->apiKey = $_POST['apiKey'];
$sushiService->customerID = $_POST['customerID'];
$sushiService->platform = $_POST['platform'];
$sushiService->security = $_POST['security'];
$sushiService->reportLayouts = $_POST['reportLayouts'];
$sushiService->releaseNumber = $_POST['releaseNumber'];
Expand Down
1 change: 1 addition & 0 deletions usage/install/protected/2022.04/001-01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE SushiService ADD COLUMN platform VARCHAR(300) NULL;
30 changes: 30 additions & 0 deletions usage/install/usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,36 @@ function register_usage_provider()
}
];

case "2022.04":
$conf_data = parse_ini_file($protected_module_data["config_file_path"], true);
return [
"dependencies_array" => [ "db_tools", "have_read_write_access_to_config" ],
"sharedInfo" => [
"config_file" => [
"path" => $protected_module_data["config_file_path"],
],
"database_name" => $conf_data["database"]["name"]
],
"function" => function($shared_module_info) use ($MODULE_VARS, $protected_module_data, $version) {
$return = new stdClass();
$return->success = true;
$return->yield = new stdClass();
$return->yield->title = _("Usage Module");
$return->yield->messages = [];
$conf_data = parse_ini_file($protected_module_data["config_file_path"], true);
// Process SQL files.
$db_name = $conf_data["database"]["name"];
$dbconnection = $shared_module_info["provided"]["get_db_connection"]( $db_name );
$ret = $shared_module_info["provided"]["process_sql_files"]( $dbconnection, $version, $MODULE_VARS["uid"] );
if (!$ret["success"]) {
$return->success = false;
$return->yield->messages = array_merge($return->yield->messages, $ret["messages"]);
return $return;
}
return $return;
}
];

default:
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion usage/js/forms/sushiSubmitForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function submitSushiService(){
type: "POST",
url: "ajax_processing.php?action=submitSushiService",
cache: false,
data: { sushiServiceID: $("#editSushiServiceID").val(), platformID: $("#platformID").val(), serviceURL: $("#serviceURL").val(), wsdlURL: $("#wsdlURL").val(), requestorID: $("#requestorID").val(), customerID: $("#customerID").val(), security: $("#security").val(), reportLayouts: $("#reportLayouts").val(), releaseNumber: $("#releaseNumber").val(), login: $("#login").val(), password: $("#password").val(), serviceDayOfMonth: $("#serviceDayOfMonth").val(), noteText: $("#noteText").val(), apiKey: $("#apiKey").val() },
data: { sushiServiceID: $("#editSushiServiceID").val(), platformID: $("#platformID").val(), serviceURL: $("#serviceURL").val(), wsdlURL: $("#wsdlURL").val(), requestorID: $("#requestorID").val(), customerID: $("#customerID").val(), platform: $("#platform").val(), security: $("#security").val(), reportLayouts: $("#reportLayouts").val(), releaseNumber: $("#releaseNumber").val(), login: $("#login").val(), password: $("#password").val(), serviceDayOfMonth: $("#serviceDayOfMonth").val(), noteText: $("#noteText").val(), apiKey: $("#apiKey").val() },
success: function(html) {
window.parent.tb_remove();
window.parent.updateSushiDetails();
Expand Down