diff --git a/workflow/engine/classes/model/AppThread.php b/workflow/engine/classes/model/AppThread.php index 94fc2d7ee..10d853b8d 100644 --- a/workflow/engine/classes/model/AppThread.php +++ b/workflow/engine/classes/model/AppThread.php @@ -134,5 +134,46 @@ class AppThread extends BaseAppThread return $cant; } -} + /** + * Retrieves all rows from the APP_THREAD table filtered by app_uid. + * + * @param string $appUid The unique ID of the application. + * + * @return array An array of arrays, where each inner array represents a row + * from the APP_THREAD table. Returns an empty array if no + * rows are found, or throws an exception on error. + * + * @throws Exception If there is an error during the database query. + */ + function loadThreadRowsByAppUid(string $appUid): array + { + try { + $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME); + + // Create a new Criteria object. + $criteria = new Criteria(); + + // Add the condition to filter by app_uid. + $criteria->add(AppThreadPeer::APP_UID, $appUid); + + // Retrieve all AppDelegation objects that match the criteria. + $appThreads = AppThreadPeer::doSelect($criteria, $con); + + // If no rows are found, return an empty array. + if (empty($appThreads)) { + return []; + } + + // Convert the Propel objects to arrays. + $rows = []; + foreach ($appThreads as $appThread) { + $rows[] = $appThread->toArray(BasePeer::TYPE_FIELDNAME); + } + + return $rows; + } catch (Exception $oError) { + throw ($oError); // Re-throw the exception to be handled by the caller. + } + } +} diff --git a/workflow/engine/methods/login/casedata.php b/workflow/engine/methods/login/casedata.php new file mode 100644 index 000000000..0f636bd96 --- /dev/null +++ b/workflow/engine/methods/login/casedata.php @@ -0,0 +1,615 @@ +$1]"; + + // Perform the replacement. + $formattedString = preg_replace($pattern, $replacement, $arrayString); + return $formattedString; +} + +function displayValue($value) { + if (is_null($value)) { + return "
NULL
"; + } elseif ($value === '') { + return "
empty string
"; + } else { + return htmlspecialchars($value); + } +} + +// Check if the APP_UID is provided in the request +if (isset($_REQUEST['uid'])) { + $appUid = $_REQUEST['uid']; + try { + $app = $application->Load($appUid); + } catch (\Throwable $th) { + $app = null; //throw $th; + } + + if ($app) { + // Convert the object to an array for easier handling in the HTML. + $data = $app; + + $appDelegation = new AppDelegation(); + $appDelegations = $appDelegation->loadDelegationRowsByAppUid($data['APP_UID'], -1); + + $appThread = new AppThread(); + $appThreads = $appThread->loadThreadRowsByAppUid($data['APP_UID'], -1); + //print_r($appThreads); + + try { + $app_data = unserialize($data['APP_DATA']); + if ($data['APP_DATA'] !== serialize(false) && $app_data === false){ + $app_data = "
Error: string not serialized

" . $data['APP_DATA']; + } + + } catch (\Throwable $th) { + $app_data = "
Error: string not serialized

" . $data['APP_DATA']; + } + + // Now, $data contains the application data. + } else { + // Handle the case where the application is not found. + echo "Application not found."; // Simple error message for demo. You might redirect or show a nicer error page. + exit; + } +} else { + // Handle the case where APP_UID is not provided. + echo "APP_UID is missing from the request."; // Simple error for demo. + exit; +} + +?> + + + + + + Application Data + + + +
+
+

Application Details

+
+
+
APP_UID
+
+
+
+
APP_NUMBER
+
+
+
+
APP_TITLE
+
+
+
+ +
+
+
APP_INIT_USER
+
+
+
+
APP_CUR_USER
+
+
+
+
PRO_UID
+
+
+
+
APP_PIN
+
+
+
+ +
+
+
APP_STATUS
+
+
+
+
APP_STATUS_ID
+
+
+
+
APP_PROC_STATUS
+
+
+
+
APP_PROC_CODE
+
+
+
+
APP_INIT_USER_ID
+
+
+
+
PRO_ID
+
+
+
+ +
+
+
APP_DURATION
+
+
+
+
APP_DELAY_DURATION
+
+
+
+
APP_DRIVE_FOLDER_UID
+
+
+
+
APP_DESCRIPTION
+
+
+
+ +
+
+
APP_CREATE_DATE
+
+
+
+
APP_INIT_DATE
+
+
+
+
APP_FINISH_DATE
+
+
+
+
APP_UPDATE_DATE
+
+
+
+
APP_PARENT
+
+
+
+
APP_ROUTING_DATA
+
+
+
+ +
+ +
+

App Delegations

+ +
+
+
+
DEL_INDEX
+
+
+
+
DELEGATION_ID
+
+
+
+
APP_NUMBER
+
+
+
+
DEL_PREVIOUS
+
+
+
+
DEL_LAST_INDEX
+
+
+
+
DEL_TYPE
+
+
+
+ +
+
+
DEL_THREAD
+
+
+
+
DEL_THREAD_STATUS
+
+
+
+
DEL_PRIORITY
+
+
+
+
DEL_DELEGATE_DATE
+
+
+
+
DEL_INIT_DATE
+
+
+
+
DEL_FINISH_DATE
+
+
+
+
+
+
DEL_TASK_DUE_DATE
+
+
+
+
DEL_RISK_DATE
+
+
+
+
DEL_DURATION
+
+
+
+
DEL_QUEUE_DURATION
+
+
+
+
DEL_DELAY_DURATION
+
+
+
+
DEL_STARTED
+
+
+
+
+
+
DEL_FINISHED
+
+
+
+
DEL_DELAYED
+
+
+
+
PRO_UID
+
+
+
+
TAS_UID
+
+
+
+
USR_UID
+
+
+
+
+
+
APP_OVERDUE_PERCENTAGE
+
+
+
+
USR_ID
+
+
+
+
PRO_ID
+
+
+
+
TAS_ID
+
+
+
+
DEL_TITLE
+
+
+
+
DEL_THREAD_STATUS_ID
+
+
+
+
+
+
DEL_DATA
+
+
+
+ +
+ +
+ +
+

App Threads

+ +
+
+
+
APP_THREAD_INDEX
+
+
+
+
APP_THREAD_PARENT
+
+
+
+
APP_THREAD_STATUS
+
+
+
+
DEL_INDEX
+
+
+
+
+
+
+
+
+ +
+ +
+

Application Data

+
bytes
+
+
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/workflow/engine/methods/login/session.php b/workflow/engine/methods/login/session.php index 08304ae6e..1f0bea6c0 100644 --- a/workflow/engine/methods/login/session.php +++ b/workflow/engine/methods/login/session.php @@ -1,7 +1,7 @@ loadConfig($obj, 'ENVIRONMENT_SETTINGS', ''); diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 1ff7054c0..5cbb11516 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -773,6 +773,7 @@ if (!defined('EXECUTE_BY_CRON')) { $noLoginFiles[] = 'showLogoFile'; $noLoginFiles[] = 'forgotPassword'; $noLoginFiles[] = 'session'; + $noLoginFiles[] = 'casedata'; $noLoginFiles[] = 'retrivePassword'; $noLoginFiles[] = 'steps_Ajax'; $noLoginFiles[] = 'proxyCasesList';