This is an automated email from the ASF dual-hosted git repository.
arunpati pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 385cbc41dd Added confirmation prompt for webtools delete actions
(OFBIZ-13405) (#1273)
385cbc41dd is described below
commit 385cbc41dd085f839ca56d86bbfa63768d6d6f8f
Author: ratneshup <[email protected]>
AuthorDate: Sat Aug 1 12:40:36 2026 +0530
Added confirmation prompt for webtools delete actions (OFBIZ-13405) (#1273)
---
framework/webtools/config/WebtoolsUiLabels.xml | 3 +++
framework/webtools/template/entity/CheckDb.ftl | 15 +++++++--------
framework/webtools/template/entity/EntityImportDir.ftl | 2 +-
framework/webtools/template/entity/ViewGeneric.ftl | 3 ++-
framework/webtools/widget/CacheForms.xml | 6 ++++--
framework/webtools/widget/GeoManagementForms.xml | 7 +++++--
framework/webtools/widget/Menus.xml | 7 ++++---
7 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/framework/webtools/config/WebtoolsUiLabels.xml
b/framework/webtools/config/WebtoolsUiLabels.xml
index 5f257dcdf4..f1707d88e2 100644
--- a/framework/webtools/config/WebtoolsUiLabels.xml
+++ b/framework/webtools/config/WebtoolsUiLabels.xml
@@ -1325,6 +1325,9 @@
<value xml:lang="en">Are you sure you want to delete?</value>
<value xml:lang="fr">Êtes-vous sûr de vouloir supprimer l'élément
?</value>
</property>
+ <property key="WebtoolsConfirmIrreversibleDelete">
+ <value xml:lang="en">This action is irreversible. Are you sure you
want to delete</value>
+ </property>
<property key="WebtoolsCount">
<value xml:lang="de">Anzahl</value>
<value xml:lang="en">Count</value>
diff --git a/framework/webtools/template/entity/CheckDb.ftl
b/framework/webtools/template/entity/CheckDb.ftl
index 90210d7ca1..17fc769518 100644
--- a/framework/webtools/template/entity/CheckDb.ftl
+++ b/framework/webtools/template/entity/CheckDb.ftl
@@ -61,7 +61,7 @@ under the License.
}
</script>
<h3>${uiLabelMap.WebtoolsRemoveAllTables}</h3>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" name="TablesRemoveForm">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" name="TablesRemoveForm"
onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsRemoveAllTables?js_string}: ' + this.groupName.value +
'?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -80,7 +80,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" name="TableRemoveForm">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" name="TableRemoveForm"
onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsRemoveAllTables?js_string}: ' + this.entityName.value +
'?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -125,7 +125,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsCreateRemoveAllPrimaryKeys?js_string}: ' +
this.groupName.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -168,7 +168,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsCreateRemovePrimaryKey?js_string}: ' +
this.entityName.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -214,7 +214,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsCreateRemoveAllDeclaredIndices?js_string}: ' +
this.groupName.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -249,7 +249,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsCreateRemoveAllForeignKeyIndices?js_string}: ' +
this.groupName.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -285,7 +285,7 @@ under the License.
</tbody>
</table>
</form>
-<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>">
+<form class="basic-form" method="post"
action="<@ofbizUrl>${checkDbURL}</@ofbizUrl>" onsubmit="return
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsCreateRemoveAllForeignKeys?js_string}: ' +
this.groupName.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
@@ -329,4 +329,3 @@ under the License.
</#list>
</ul>
</#if>
-
diff --git a/framework/webtools/template/entity/EntityImportDir.ftl
b/framework/webtools/template/entity/EntityImportDir.ftl
index f47154e650..f21e17c75b 100644
--- a/framework/webtools/template/entity/EntityImportDir.ftl
+++ b/framework/webtools/template/entity/EntityImportDir.ftl
@@ -26,7 +26,7 @@ under the License.
</#if>
<hr />
- <form class="basic-form" method="post"
action="<@ofbizUrl>entityImportDir</@ofbizUrl>">
+ <form class="basic-form" method="post"
action="<@ofbizUrl>entityImportDir</@ofbizUrl>" onsubmit="return
!this.deleteFiles.checked ||
confirm('${uiLabelMap.WebtoolsConfirmIrreversibleDelete?js_string}
${uiLabelMap.WebtoolsDeleteFiles?js_string}: ' + this.path.value + '?');">
<table class="basic-table" cellspacing="0">
<tbody>
<tr>
diff --git a/framework/webtools/template/entity/ViewGeneric.ftl
b/framework/webtools/template/entity/ViewGeneric.ftl
index bdb757e430..b7084f7ce4 100644
--- a/framework/webtools/template/entity/ViewGeneric.ftl
+++ b/framework/webtools/template/entity/ViewGeneric.ftl
@@ -60,7 +60,8 @@ function ShowTab(lname) {
</#if>
<#if value?has_content>
<#if hasDeletePermission>
- <form
action='<@ofbizUrl>entity/change/${currentFindString}</@ofbizUrl>'
method="post" name="updateForm">
+ <#assign deleteConfirmMessage =
"${uiLabelMap.WebtoolsConfirmIrreversibleDelete} ${entityName} ${findByPk}?" />
+ <form
action='<@ofbizUrl>entity/change/${currentFindString}</@ofbizUrl>'
method="post" name="updateForm" onsubmit="return
confirm('${deleteConfirmMessage?js_string}');">
<input type="hidden" value="DELETE" name="_method"/>
<#list pkNamesValuesMap.keySet() as pkName>
<input type="hidden" value="${pkNamesValuesMap.get(pkName)}"
name="${pkName}"/>
diff --git a/framework/webtools/widget/CacheForms.xml
b/framework/webtools/widget/CacheForms.xml
index e25e364e1f..aea86b2df6 100644
--- a/framework/webtools/widget/CacheForms.xml
+++ b/framework/webtools/widget/CacheForms.xml
@@ -52,7 +52,8 @@ under the License.
</hyperlink>
</field>
<field name="FindUtilCacheClear" title=" " use-when="hasUtilCacheEdit"
widget-style="buttontext">
- <hyperlink description="${uiLabelMap.CommonClear}"
target="FindUtilCacheClear" >
+ <hyperlink description="${uiLabelMap.CommonClear}"
target="FindUtilCacheClear"
+ request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete} cache
${cacheName}?">
<parameter param-name="UTIL_CACHE_NAME"
from-field="cacheName"/>
</hyperlink>
</field>
@@ -64,7 +65,8 @@ under the License.
<field name="lineSize" title="${uiLabelMap.WebtoolsBytes}"
sort-field="true"><display/></field>
<field name="administration" title=" " widget-style="buttontext"
use-when="hasUtilCacheEdit">
- <hyperlink description="${uiLabelMap.CommonRemove}"
target="FindUtilCacheElementsRemoveElement">
+ <hyperlink description="${uiLabelMap.CommonRemove}"
target="FindUtilCacheElementsRemoveElement"
+ request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete} cache
element ${elementKey}?">
<parameter param-name="UTIL_CACHE_NAME"
from-field="cacheName"/>
<parameter param-name="UTIL_CACHE_ELEMENT_NUMBER"
from-field="keyNum"/>
</hyperlink>
diff --git a/framework/webtools/widget/GeoManagementForms.xml
b/framework/webtools/widget/GeoManagementForms.xml
index b3f7c607c4..0a04b65520 100644
--- a/framework/webtools/widget/GeoManagementForms.xml
+++ b/framework/webtools/widget/GeoManagementForms.xml
@@ -60,7 +60,8 @@
</field>
<field name="wellKnownText"
title="${uiLabelMap.CommonGeoWellKnownText}"><display/></field>
<field name="deleteLink" title=" " widget-style="buttontext">
- <hyperlink description="${uiLabelMap.CommonRemove}"
target="deleteGeo">
+ <hyperlink description="${uiLabelMap.CommonRemove}"
target="deleteGeo"
+ request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete} Geo
${geoId}?">
<parameter param-name="geoId"/>
<parameter param-name="noConditionFind" value="Y"/>
</hyperlink>
@@ -172,7 +173,9 @@
<field name="geoAssocTypeId"
title="${uiLabelMap.CommonGeoAssocTypeId}">
<display-entity entity-name="GeoAssocType"
key-field-name="geoAssocTypeId"/>
</field>
- <field name="delete"
title="${uiLabelMap.CommonDelete}"><submit/></field>
+ <field name="delete" title="${uiLabelMap.CommonDelete}">
+ <submit request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete} GeoAssoc
${geoId} -> ${geoIdTo}?"/>
+ </field>
</grid>
</forms>
diff --git a/framework/webtools/widget/Menus.xml
b/framework/webtools/widget/Menus.xml
index f4deacd485..4d7a342e5c 100644
--- a/framework/webtools/widget/Menus.xml
+++ b/framework/webtools/widget/Menus.xml
@@ -262,13 +262,14 @@ under the License.
<link target="FindUtilCache"/>
</menu-item>
<menu-item name="clearAll"
title="${uiLabelMap.WebtoolsClearAllCaches}">
- <link target="FindUtilCacheClearAll"/>
+ <link target="FindUtilCacheClearAll" request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete}
${uiLabelMap.WebtoolsClearAllCaches}?"/>
</menu-item>
<menu-item name="forceGarbageCollection"
title="${uiLabelMap.WebtoolsRunGC}">
<link target="ForceGarbageCollection"/>
</menu-item>
<menu-item name="clearSelectedCaches"
title="${uiLabelMap.WebtoolsClearSelectedCaches}">
- <link target="javascript: document.ListCache.submit()"
url-mode="plain"/>
+ <link target="javascript: document.ListCache.submit()"
url-mode="plain"
+ request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete}
${uiLabelMap.WebtoolsClearSelectedCaches}?"/>
</menu-item>
</menu>
@@ -280,7 +281,7 @@ under the License.
<menu name="EditCache" extends="CommonButtonBarMenu"
extends-resource="component://common/widget/CommonMenus.xml">
<menu-item name="clear" title="${uiLabelMap.WebtoolsClearThisCache}">
- <link target="EditUtilCacheClear">
+ <link target="EditUtilCacheClear" request-confirmation="true"
confirmation-message="${uiLabelMap.WebtoolsConfirmIrreversibleDelete} cache
${cacheName}?">
<parameter param-name="UTIL_CACHE_NAME" from-field="cacheName"/>
<parameter param-name="type" from-field="parameters.type"/>
</link>