devsofttech_hms_ci4/app/Views/Setting/Template
DevSoftTech Server d025111bcc Fix: IPD discharge template delete not working
ISSUE: Delete button executed but did not actually delete templates
ROUTE: /setting/template/discharge_templates/delete/{id}

ROOT CAUSE:
The delete button's fetch() call was sending 'new FormData(form)' which:
1. Included entire edit form data (template_html, header_html, footer_html)
2. These are HUGE LONGTEXT fields that can cause request payload issues
3. CSRF token from form might be stale or missing if no template is being edited
4. Server received malformed request and silently failed

SOLUTION:
- Create fresh FormData with ONLY the CSRF token
- Delete request now lightweight and reliable
- Added success message display after successful delete
- Server-side delete logic already correct (line 2969-3028 in Template.php)

CHANGED:
- app/Views/Setting/Template/discharge_templates.php (line 618-653)
  - Replace: body: new FormData(form)
  - With: body: deleteFormData (contains only CSRF token)
  - Added: setNotice('success', ...) to show success message

TESTING:
1. Go to /setting/template/discharge_templates
2. Click Delete on any non-default template
3. Confirm deletion
4. Template should now be removed from list
5. Success message should display
2026-06-07 11:11:41 +05:30
..
diagnosis_print_settings.php refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
discharge_templates.php Fix: IPD discharge template delete not working 2026-06-07 11:11:41 +05:30
document_print_settings.php Add placeholder panel to document print settings; autocomplete off on med inputs; localStorage medicine cache 2026-04-09 03:43:53 +05:30
index.php Refine OPD template builder UI and preview behavior 2026-06-05 03:34:08 +05:30
ipd_document_templates.php Make IPD forms dynamic and stop stale OPD refresh polling 2026-04-08 11:41:33 +05:30