Remove debug code from template management
- Remove debug logging from action handling - Remove debug logging from template reset method - Remove debug logging from template info method - Clean up production code after successful debugging
This commit is contained in:
parent
e8f9ab260a
commit
3631b33079
@ -36,7 +36,6 @@ $form = new Form($db);
|
||||
|
||||
// Handle form submission
|
||||
$action = GETPOST('action', 'alpha');
|
||||
error_log("DeclarationTVA: Action received: " . $action);
|
||||
|
||||
// Handle template actions (must be processed before tab logic)
|
||||
if ($action == 'upload_template' || $action == 'reset_template' || $action == 'update_template') {
|
||||
@ -54,12 +53,9 @@ if ($action == 'upload_template' || $action == 'reset_template' || $action == 'u
|
||||
}
|
||||
|
||||
if ($action == 'reset_template') {
|
||||
error_log("DeclarationTVA: Reset template action triggered");
|
||||
if ($pdf_generator->resetToDefaultTemplate()) {
|
||||
error_log("DeclarationTVA: Reset template SUCCESS");
|
||||
setEventMessages($langs->trans("TemplateReset"), null, 'mesgs');
|
||||
} else {
|
||||
error_log("DeclarationTVA: Reset template FAILED");
|
||||
setEventMessages($langs->trans("TemplateResetFailed"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1496,10 +1496,6 @@ class DeclarationTVA_PDF
|
||||
);
|
||||
|
||||
$custom_template = $this->template_path . 'ca3_custom_template.pdf';
|
||||
error_log("DeclarationTVA: Template info - looking for: " . $custom_template);
|
||||
error_log("DeclarationTVA: Template info - path: " . $this->template_path);
|
||||
error_log("DeclarationTVA: Template info - exists: " . (file_exists($custom_template) ? 'YES' : 'NO'));
|
||||
|
||||
if (file_exists($custom_template)) {
|
||||
$info['custom_template'] = true;
|
||||
$info['template_path'] = $custom_template;
|
||||
@ -1516,16 +1512,9 @@ class DeclarationTVA_PDF
|
||||
public function resetToDefaultTemplate()
|
||||
{
|
||||
$custom_template = $this->template_path . 'ca3_custom_template.pdf';
|
||||
error_log("DeclarationTVA: Reset template - looking for: " . $custom_template);
|
||||
error_log("DeclarationTVA: Template path: " . $this->template_path);
|
||||
error_log("DeclarationTVA: File exists: " . (file_exists($custom_template) ? 'YES' : 'NO'));
|
||||
|
||||
if (file_exists($custom_template)) {
|
||||
$result = unlink($custom_template);
|
||||
error_log("DeclarationTVA: Delete result: " . ($result ? 'SUCCESS' : 'FAILED'));
|
||||
return $result;
|
||||
return unlink($custom_template);
|
||||
}
|
||||
error_log("DeclarationTVA: No custom template to delete");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user