From 8b4c71d1a39372562818b6d58fb9835bc3823c22 Mon Sep 17 00:00:00 2001
From: mahdahar <89adham@gmail.com>
Date: Thu, 5 Feb 2026 13:23:03 +0700
Subject: [PATCH] feat: Replace PDF retry with direct link and generate dialog
---
app/Views/shared/content_requests.php | 8 ++++----
app/Views/shared/script_requests.php | 20 +-------------------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/app/Views/shared/content_requests.php b/app/Views/shared/content_requests.php
index 61a21c6..2982a4a 100644
--- a/app/Views/shared/content_requests.php
+++ b/app/Views/shared/content_requests.php
@@ -232,15 +232,15 @@ class="dropdown-content menu bg-base-100 rounded-box z-[1] w-40 p-2 shadow-lg bo
-
+
PDF
-
-
-
+
+
+Generate Result
diff --git a/app/Views/shared/script_requests.php b/app/Views/shared/script_requests.php
index 8504681..790c627 100644
--- a/app/Views/shared/script_requests.php
+++ b/app/Views/shared/script_requests.php
@@ -6,7 +6,7 @@ document.addEventListener('alpine:init', () => {
list: [],
isLoading: false,
counters: { Pend: 0, Coll: 0, Recv: 0, Inc: 0, Fin: 0, Total: 0 },
- retryingPdf: {},
+
selectedPrinter: 'lab',
// PDF Generation Dialog
isGenerateDialogOpen: false,
@@ -326,24 +326,6 @@ document.addEventListener('alpine:init', () => {
return this.getAllAuditEvents.filter(e => e.category === this.auditTab);
},
- async retryPdf(accessnumber) {
- if (this.retryingPdf[accessnumber]) return;
-
- this.retryingPdf[accessnumber] = true;
- try {
- const res = await fetch(`${BASEURL}/report/${accessnumber}/pdf`);
- const data = await res.json();
- if (data.success) {
- this.showToast('PDF queued for generation', 'success');
- } else {
- throw new Error(data.error || 'Unknown error');
- }
- } catch (e) {
- this.showToast('PDF generation failed - try again', 'error');
- } finally {
- this.retryingPdf[accessnumber] = false;
- }
- },
/*
PDF Generation Dialog methods