diff --git a/.idea/DynamicFormToolsProject.xml b/.idea/DynamicFormToolsProject.xml new file mode 100644 index 0000000..77f7241 --- /dev/null +++ b/.idea/DynamicFormToolsProject.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 435aae6..ffe66dc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -56,6 +56,12 @@ + + + + + + diff --git a/.intellijPlatform/coroutines-javaagent-legacy.jar b/.intellijPlatform/coroutines-javaagent-legacy.jar index 7bde603..914ff94 100644 Binary files a/.intellijPlatform/coroutines-javaagent-legacy.jar and b/.intellijPlatform/coroutines-javaagent-legacy.jar differ diff --git a/.intellijPlatform/self-update.lock b/.intellijPlatform/self-update.lock index e5d60f1..33766b8 100644 --- a/.intellijPlatform/self-update.lock +++ b/.intellijPlatform/self-update.lock @@ -1 +1 @@ -2026-04-22 \ No newline at end of file +2026-05-14 \ No newline at end of file diff --git a/DevResources/full-examples/bdgt04/exec/bdgt04-actions.jsp b/DevResources/full-examples/bdgt04/exec/bdgt04-actions.jsp index 7c944b0..afc9393 100755 --- a/DevResources/full-examples/bdgt04/exec/bdgt04-actions.jsp +++ b/DevResources/full-examples/bdgt04/exec/bdgt04-actions.jsp @@ -11,7 +11,7 @@ SDKLogger logger = new SDKLogger("Operate-actions"); - public boolean bgt0102010_add(SystemFactory factory, JSONObject jsData) { + public boolean flowAdd(SystemFactory factory, JSONObject jsData) { if (!jsData.getString("-- some important field --").isBlank()) { DBConnector dbConn = factory.appDatabase.getXConnector(); try { @@ -45,6 +45,14 @@ return true; } + public boolean flowUpdate(SystemFactory factory, JSONObject jsData) { + return true; + } + + public boolean flowDelete(SystemFactory factory, JSONObject jsData) { + return true; + } + public boolean _action_skeleton(SystemFactory factory, JSONObject jsData) { if (!jsData.getString("-- some important field --").isBlank()) { DBConnector dbConn = factory.appDatabase.getXConnector(); @@ -62,7 +70,7 @@ return true; } - public boolean execute(String action, SystemFactory factory) { + private boolean execute(String action, SystemFactory factory) { try { Class thisClass = getClass(); Method mtAction = thisClass.getMethod(action, SystemFactory.class, JSONObject.class); diff --git a/DevResources/full-examples/bdgt04/view/frm/bdgt-0401010.frml b/DevResources/full-examples/bdgt04/view/frm/bdgt-0401010.frml index 1ff2a45..13b52f1 100644 --- a/DevResources/full-examples/bdgt04/view/frm/bdgt-0401010.frml +++ b/DevResources/full-examples/bdgt04/view/frm/bdgt-0401010.frml @@ -1,5 +1,5 @@ - + @@ -94,6 +94,7 @@
+
0 diff --git a/DevResources/full-examples/bdgt04/view/frm/grids/grid-stratigy.frml b/DevResources/full-examples/bdgt04/view/frm/grids/grid-stratigy.frml index 7fcc58e..6c88913 100644 --- a/DevResources/full-examples/bdgt04/view/frm/grids/grid-stratigy.frml +++ b/DevResources/full-examples/bdgt04/view/frm/grids/grid-stratigy.frml @@ -1,5 +1,5 @@ - + APP diff --git a/DevResources/full-examples/bdgt05X/defs/ajax.xml b/DevResources/full-examples/bdgt05X/defs/ajax.xml new file mode 100644 index 0000000..25237df --- /dev/null +++ b/DevResources/full-examples/bdgt05X/defs/ajax.xml @@ -0,0 +1,201 @@ + + + + BUD + Main Activity + 100 + + + FROM PROJECT_M PJM + + WHERE (PJM.PJM_CODE LIKE '%'||:SEARCH||'%' OR PJM.PJM_NAME LIKE '%'||:SEARCH||'%') + + + + + + + + BUD + Main Activity + 100 + + + FROM BGT.V_ACTIVITY_TREE ACM + + WHERE 0=0 + AND (:DV_YEAR BETWEEN ACM_START_YEAR AND ACM_END_YEAR) + -- AND (ACM.STM_CODE = '%' OR ACM.STM_CODE = :STM_CODE) + AND (ACM.ACM_CODE LIKE '%'||:SEARCH||'%' OR ACM.ACM_NAME LIKE '%'||:SEARCH||'%') + + + + + + + + BUD + Main Activity + 100 + + + FROM BUDGET_M BGD + + WHERE (BGD.BGM_CODE LIKE '%'||:SEARCH||'%' OR BGD.BGM_NAME LIKE '%'||:SEARCH||'%') + + ORDER BY BGM_CODE + + + + + APP + + + FROM REFER_CODE + WHERE (RFG_GRP = 'STG-ITEMS') + AND (RFC_CODE LIKE '%'||:SEARCH||'%' OR RFC_DESC LIKE '%'||:SEARCH||'%') + ORDER BY RFC_CODE + + + + + APP + + + FROM REFER_CODE + WHERE (RFG_GRP = :RFG_GRP) + AND (RFC_CODE LIKE '%'||:SEARCH||'%' OR RFC_DESC LIKE '%'||:SEARCH||'%') + ORDER BY RFC_CODE + + + + + + BUD + Main Activity + 100 + + + FROM BGT.V_ACTIVITY_TREE ACM + + WHERE 0=0 + AND (:DV_YEAR BETWEEN ACM_START_YEAR AND ACM_END_YEAR) + -- AND (ACM.STM_CODE = '%' OR ACM.STM_CODE = :STM_CODE) + AND (ACM.ACM_CODE LIKE '%'||:SEARCH||'%' OR ACM.ACM_NAME LIKE '%'||:SEARCH||'%') + + + + + + + + APP + Main Activity + 100 + + + FROM V_BUDGET_TREE BGM + + WHERE (BGM.BGM_CODE LIKE '%'||:SEARCH||'%' OR BGM.BGM_NAME LIKE '%'||:SEARCH||'%') + + ORDER BY BGM_SEQ + + + + + + + APP + Main Activity + 100 + + + FROM V_BUDGET_TREE BGM + + WHERE (BGM_CODE LIKE '3.1%') + AND (BGM.BGM_CODE LIKE '%'||:SEARCH||'%' OR BGM.BGM_NAME LIKE '%'||:SEARCH||'%') + + ORDER BY BGM_SEQ + + + + \ No newline at end of file diff --git a/DevResources/full-examples/bdgt05X/view/bgt0501010-general.jsp b/DevResources/full-examples/bdgt05X/view/bgt0501010-general.jsp new file mode 100644 index 0000000..653d52d --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/bgt0501010-general.jsp @@ -0,0 +1,50 @@ +<%@ page import="org.apache.commons.codec.*" %> +<%@ page contentType="text/html; charset=UTF-8" language="java" %> +<%@ include file="/WEB-INF/app/system/dynf/dynfSysInfo.jsp" %> + +

<%=pageItemInfo.getProgTitle()%>

+<% + String _formId = "bdgt-0501010/general"; + try { + String data = factory.rqsCtx.getParameter("data",""); + boolean detailMode = false; + if (!data.isBlank()) { + data = JUtils.decBase64(data); + data = URLDecoder.decode(data, CharEncoding.UTF_8); + + JSONObject jsData = new JSONObject(data); + String type = jsData.getString("type").toLowerCase(); + String acmCode = jsData.getString("acm_code"); + String projId = jsData.getString("proj_id"); + + if (type.equals("rutn")) { + _formId = "bdgt-0501010/routine"; + } else if (type.equals("mngt")) { + _formId = "bdgt-0501010/manage"; + } else if (type.equals("eqpt")) { + _formId = "bdgt-0501010/equipt"; + } else if (type.equals("cnst")) { + _formId = "bdgt-0501010/construct"; + } + + detailMode = true; + dynForm = new DynForm(application, request, response, "bdgt05", _formId); + dynForm.setFormOwner(request.getRequestURL().toString()); + dynForm.setFormvar("ACM_CODE",acmCode); + dynForm.setFormvar("PROJ_ID",projId); + } else { + dynForm = new DynForm(application, request, response, "bdgt05", _formId); + } + + if (detailMode) { + factory.pageCtx.addWidget(DynConstants.PageWidget.FileBox); + %><%@ include file="/WEB-INF/app/system/dynf/dynfDataEdit.jsp" %><% + } else { + %><%@ include file="/WEB-INF/app/system/dynf/dynfDataList.jsp" %><% + } + } catch (Exception ex) { + factory.setRestCode("ERROR"); + factory.setRestMsg(ex.getMessage() + "\n" + JUtils.stackToString(ex,16)); + logger.error(ex.getMessage(),ex); + } +%> diff --git a/DevResources/full-examples/bdgt05X/view/bgt0501010.jsp b/DevResources/full-examples/bdgt05X/view/bgt0501010.jsp new file mode 100644 index 0000000..e91888d --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/bgt0501010.jsp @@ -0,0 +1,20 @@ +<%@ page contentType="text/html; charset=UTF-8" language="java" %> +<%@ include file="/WEB-INF/app/system/dynf/dynfSysInfo.jsp" %> + +

<%=pageItemInfo.getProgTitle()%>

+<% + try { + dynForm = new DynForm(application, request, response, "bdgt05", "bdgt-0501010"); + dynForm.setFormOwner(request.getRequestURL().toString()); + dynForm.setFormvar("USER_CODE",factory.user.getUSER_CODE()); + if (dynForm.workIn(WorkMode.Editing)) { + %><%@ include file="/WEB-INF/app/system/dynf/dynfDataEdit.jsp" %><% + } else { + %><%@ include file="/WEB-INF/app/system/dynf/dynfDataList.jsp" %><% + } + } catch (Exception ex) { + factory.setRestCode("ERROR"); + factory.setRestMsg(ex.getMessage() + "\n" + JUtils.stackToString(ex,16)); + logger.error(ex.getMessage(),ex); + } +%> diff --git a/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010.frml b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010.frml new file mode 100644 index 0000000..3aec1a2 --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010.frml @@ -0,0 +1,99 @@ + + + + + APP + PROJECTS + PROJ_ID + + + + FROM PROPOSALS PRPS + INNER JOIN V_PROJECT_STATE VPSTT on PRPS.PROP_ID = VPSTT.PROP_ID + LEFT OUTER JOIN PROPS_PROJECTS PROJ ON PRPS.PROP_ID = PROJ.PROJ_ID + INNER JOIN V_PROPS_APPROVERS PAPVS ON PAPVS.PROP_ID=PRPS.PROP_ID + + WHERE PRPS.FLOW_TYPE = 'PROP-GNL-01' AND PAPVS.FAPV_APPROVER = :USER_CODE + ORDER BY PRPS.PROP_ID + + + + + +
+ 0 + + + + + {return $(`
${value}
`);}]]> +
+
+ + + {return $(`
${value}
`);}]]> +
+
+ + + {return $(`${value}`);}]]> + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/construct.frml b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/construct.frml new file mode 100644 index 0000000..11fafdf --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/construct.frml @@ -0,0 +1,322 @@ + + + + + + + + + APP + PROJECTS + PROJ_ID + + + FROM PROJECTS + WHERE PROJ_ID = :PROJ_ID + ORDER BY PROJ_ID + + + + + + + + + + + + + + + + + + + + + APP + PROJECT_CONST_INFO + PROJ_ID,ACM_CODE + + + FROM PROJECT_CONST_INFO + ORDER BY PROJ_ID, ACM_CODE + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+
+
+ @M{project.year_budgets}]]> +
+ + + + + + + +
+ +
+
+ @M{pcti.location_info} + ]]> +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ @M{project.budget}]]> +
+ + + +
+ +
+
+ @M{project.constructor_attatchment}]]> +
+ + + + + + + + + + + +
+ +
+
+ การส่งกลับแก้ไข]]>
+ + +
+ +
+ +
+
+ +
+
ประวัติการแก้ไข
+
    +
  • แก้ครั้งที่ 1 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 2 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 3 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 4 วันที่ xx/xx/xxxx : ...................................
  • +
+
+ ]]> +
+
+ +
+
+ เอกสารประกอบการพิจารณา]]> +
+ + + + + + + + + +
+ +
+ +
+
+
diff --git a/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/equipt.frml b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/equipt.frml new file mode 100644 index 0000000..6b6e46b --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/equipt.frml @@ -0,0 +1,348 @@ + + + + + APP + PROJECT_BUDGETS + PROJ_ID,ACM_CODE + + + FROM PROJECT_BUDGETS PBDG + INNER JOIN PROJECTS PMAS ON PMAS.PROJ_ID = PBDG.PROJ_ID + + ORDER BY PROJ_ID,PBDG_ID + + + + + + + + + + + + + + APP + PROJECT_TARGETS + PROJ_ID,ACM_CODE + + + FROM PROJECT_TARGETS + ORDER BY PROJ_ID,ACM_CODE + + + + + + + + + + + + + + + + + + + APP + PROJECT_BUDGET_ITEMS + PROJ_ID,BGM_CODE,PBDG_ID + + + FROM PROJECT_BUDGET_ITEMS + ORDER BY PROJ_ID,BGM_CODE,PBDG_ID + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + + + + + + + { + console.log("call formater with ", data); + return $(`
:
`); + } + ]]>
+
+
+ + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + +
+ +
+
+ @M{project.target}]]> +
+ + + + + + + + +
+ +
+
+ @M{pbge.quotaion_file}]]> +
+ + + + + + + + + +
+ +
+
+ การส่งกลับแก้ไข]]>
+ + +
+ +
+ +
+
+ +
+
ประวัติการแก้ไข
+
    +
  • แก้ครั้งที่ 1 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 2 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 3 วันที่ xx/xx/xxxx : ...................................
  • +
  • แก้ครั้งที่ 4 วันที่ xx/xx/xxxx : ...................................
  • +
+
+ ]]> +
+
+ +
+
+ เอกสารประกอบการพิจารณา]]> +
+ + + + + + + + + +
+ +
+ + +
+
+
diff --git a/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/general.frml b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/general.frml new file mode 100644 index 0000000..6c29005 --- /dev/null +++ b/DevResources/full-examples/bdgt05X/view/frm/bdgt-0501010/general.frml @@ -0,0 +1,259 @@ + + + + + APP + PROPS_PROJECTS + PROP_ID + + + FROM PROPS_PROJECTS PROJ + INNER JOIN PROPOSALS_PROJECTS PPROJ ON PROJ.PROJ_ID=PPROJ.PROJ_ID + INNER JOIN V_PROJECT_STATE VPSTT ON VPSTT.PROJ_ID=PPROJ.PROJ_ID + + WHERE PPROJ.PROP_ID = :PROP_ID + ORDER BY VPSTT.PROJ_ORDER + + + + + + + + + + + + + + + + + + + + + + + APP + V_ACTIVITY_TREE + + + + FROM BGT.V_ACTIVITY_TREE ACTT + INNER JOIN (SELECT DISTINCT ACM.ACM_CODE + FROM BUD.ACTIVITY_M ACM + INNER JOIN BUD.ACTIVITY_CTRL_H ACH ON ACM.ACM_CODE = ACH.ACH_CODE + START WITH ACM.ACM_CODE IN (SELECT ACM_CODE FROM V_PROJECT_ACTIVITY PACT WHERE PACT.PROJ_ID = :PROJ_ID) + CONNECT BY PRIOR ACH.ACH_CTRL_CODE = ACH.ACH_CODE) FLTR ON FLTR.ACM_CODE = ACTT.ACM_CODE + LEFT OUTER JOIN V_PROJECT_ACTIVITY PACT ON PACT.ACM_CODE = ACTT.ACM_CODE AND PACT.PROJ_ID = :PROJ_ID + + + ORDER BY ACTT.ACM_SEQ + + + + + +
+ +
+ 0 + + + + + {return $(`
${value}
`);}]]> +
+
+ + + {return $(`
${value}
`);}]]> +
+
+ + + { + if (row["node_type"] === "D") { + return `
${formatNumber(value,"#,##0")} ${row["acm_unit"]}
`; + } else { + return "" + } + }]]> +
+
+ + + + + +
+ + + + + + + + + + +