Skip to content

Commit

Permalink
as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
juggernautsei committed May 23, 2024
1 parent 7d4ed14 commit 8d71c34
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function moduleManagerAction($methodName, $modId, string $currentActionSt
if (method_exists(self::class, $methodName)) {
return self::$methodName($modId, $currentActionStatus);
} else {
// no reason to report action method is missing.
// no reason to report, action method is missing.
return $currentActionStatus;
}
}
Expand Down Expand Up @@ -103,6 +103,12 @@ private function help_requested($modId, $currentActionStatus): mixed
*/
private function enable($modId, $currentActionStatus): mixed
{
$logMessage = 'Claimrev Background tasks have been enabled';
// Register background services
$sql = "UPDATE `background_services` SET `active` = '1' WHERE `name` = ? OR `name` = ? OR `name` = ?";
$status = sqlQuery($sql, array('ClaimRev_Send', 'ClaimRev_Receive', 'ClaimRev_Elig_Send_Receive'));
error_log($logMessage . ' ' . text($status));
// Return the current action status from Module Manager in case of error from its action.
return $currentActionStatus;
}

Expand All @@ -113,7 +119,11 @@ private function enable($modId, $currentActionStatus): mixed
*/
private function disable($modId, $currentActionStatus): mixed
{
// allow config button to show before enable.
$logMessage = 'Claimrev Background tasks have been disabled';
// Unregister background services
$sql = "UPDATE `background_services` SET `active` = '0' WHERE `name` = ? OR `name` = ? OR `name` = ?";
$status = sqlQuery($sql, array('ClaimRev_Send', 'ClaimRev_Receive', 'ClaimRev_Elig_Send_Receive'));
error_log($logMessage . ' ' . text($status));
return $currentActionStatus;
}

Expand All @@ -122,12 +132,12 @@ private function disable($modId, $currentActionStatus): mixed
* @param $currentActionStatus
* @return mixed
*/
private function unregister($currentActionStatus): mixed
private function unregister($modId, $currentActionStatus)
{
$logMessage = ''; // Initialize an empty string to store log messages
$logMessage = 'Claimrev Background tasks have been removed'; // Initialize an empty string to store log messages
$sql = "DELETE FROM `background_services` WHERE `name` = ? OR `name` = ? OR `name` = ?";
sqlQuery($sql, array('ClaimRev_Send', 'ClaimRev_Receive', 'ClaimRev_Elig_Send_Receive'));
error_log(text($logMessage));
$status = sqlQuery($sql, array('ClaimRev_Send', 'ClaimRev_Receive', 'ClaimRev_Elig_Send_Receive'));
error_log($logMessage . ' ' . text($status));
return $currentActionStatus;
}
}

0 comments on commit 8d71c34

Please sign in to comment.