diff --git a/.serena/project.yml b/.serena/project.yml index 720b18f..4cfc21a 100644 --- a/.serena/project.yml +++ b/.serena/project.yml @@ -121,3 +121,7 @@ symbol_info_budget: # Note: the backend is fixed at startup. If a project with a different backend # is activated post-init, an error will be returned. language_backend: + +# list of regex patterns which, when matched, mark a memory entry as read‑only. +# Extends the list from the global configuration, merging the two lists. +read_only_memory_patterns: [] diff --git a/app/Controllers/ReportController.php b/app/Controllers/ReportController.php index 0bd9af5..1944a97 100644 --- a/app/Controllers/ReportController.php +++ b/app/Controllers/ReportController.php @@ -132,7 +132,27 @@ try { $sqlLog = "INSERT INTO GDC_CMOD.dbo.AUDIT_REQUESTS(ACCESSNUMBER, STEPDATE, STEPTYPE, STEPSTATUS) VALUES (?, GETDATE(), ?, ?)"; $this->db->query($sqlLog, [$accessnumber, $stepType, $stepStatus]); - + + try { + $oruDir = 'c:\inetpub\wwwroot\spooler_db\process_oru'; + if (!is_dir($oruDir)) { + mkdir($oruDir, 0777, true); + } + + $oruFile = "$oruDir/$accessnumber.oru"; + $date = date('Y-m-d H:i'); + $status = $data['status'] ?? 'PENDING'; + $file = fopen($oruFile, 'w+'); + fwrite($file, "$accessnumber\r\n$hostnumber\r\n$date\r\n$status\r\n-"); + fclose($file); + + $sqlOruLog = "INSERT INTO GDC_CMOD.dbo.AUDIT_REQUESTS(ACCESSNUMBER, STEPDATE, STEPTYPE, STEPSTATUS) + VALUES (?, GETDATE(), 'ORU_FILE', 'Created')"; + $this->db->query($sqlOruLog, [$accessnumber]); + } catch (\Throwable $e) { + log_message('error', "ORU file creation failed for $accessnumber: " . $e->getMessage()); + } + return $this->response->setJSON([ 'success' => true, 'jobId' => $jobId,