From 5a270d56b5615e185844edd83cc3dd631e08d52b Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Tue, 9 Sep 2008 16:05:42 +0000
Subject: [PATCH] report_section refactoring to be more generic and easier to
 customize with more pdf

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23527 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...cument_validateFormDataBeforeSubmission.xml | 18 +++++-------------
 bt5/erp5_egov/bt/revision                      |  2 +-
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml b/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
index 91b8baeed0..6d7d2683e4 100644
--- a/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
+++ b/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
@@ -74,19 +74,8 @@ N_ = portal.Base_translateString\n
 portal_type = document.getPortalType()\n
 \n
 # dict of required documents\n
-attachement_type_dict = { \'Declaration TVA\':\n
-                            {\n
-                             \'ID Card\':\'Required\',\n
-                             \'Expenditure Table\':\'Optional\',\n
-                             \'Exemptions Details\':\'Required\',\n
-                             \'Application Certificate\':\'Optional\',\n
-                            },\n
-                          \'Subscription Form\':\n
-                            {\n
-                             \'ID Card\':\'Required\',\n
-                             \'M0 Form\':\'Required\',\n
-                            }\n
-                        }\n
+attachement_method = getattr(context, \'%s_getApplicationIncomeDict\' % context.getPortalType().replace(\' \', \'\'))\n
+attachement_type_dict = attachement_method()\n
 \n
 # if the portal type is not mapped, no attached files are required\n
 if not attachement_type_dict.has_key(portal_type):\n
@@ -157,6 +146,9 @@ if len(missing_document_list):\n
                             <string>portal</string>
                             <string>N_</string>
                             <string>portal_type</string>
+                            <string>getattr</string>
+                            <string>context</string>
+                            <string>attachement_method</string>
                             <string>attachement_type_dict</string>
                             <string>append</string>
                             <string>$append0</string>
diff --git a/bt5/erp5_egov/bt/revision b/bt5/erp5_egov/bt/revision
index 8bc94cb760..c6876402f5 100644
--- a/bt5/erp5_egov/bt/revision
+++ b/bt5/erp5_egov/bt/revision
@@ -1 +1 @@
-276
\ No newline at end of file
+278
\ No newline at end of file
-- 
2.30.9