From 2f10c3ed3e25293d9b8eb40c4434a3841e39d297 Mon Sep 17 00:00:00 2001 From: Andrea Adamczyk Date: Wed, 24 Feb 2021 08:44:16 -0400 Subject: [PATCH] PMCORE-2335 --- .../translations/english/processmaker.en.po | 6 +++++ workflow/engine/data/mysql/insert.sql | 1 + .../engine/templates/pmTables/editReport.js | 22 +++++++++++++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/workflow/engine/content/translations/english/processmaker.en.po b/workflow/engine/content/translations/english/processmaker.en.po index a8e352c35..02f8b9a3b 100755 --- a/workflow/engine/content/translations/english/processmaker.en.po +++ b/workflow/engine/content/translations/english/processmaker.en.po @@ -25619,6 +25619,12 @@ msgstr "Table Name" msgid "[LABEL/ID_TABLE_NAME_IS_REQUIRED] Table Name is required." msgstr "Table Name is required." +# TRANSLATION +# LABEL/ID_TABLE_AND_PROCESS_NAME_ARE_REQUIRED +#: LABEL/ID_TABLE_AND_PROCESS_NAME_ARE_REQUIRED +msgid "Table and Process Name are required." +msgstr "Table and Process Name are required." + # TRANSLATION # LABEL/ID_TABLE_NAME_TOO_SHORT #: LABEL/ID_TABLE_NAME_TOO_SHORT diff --git a/workflow/engine/data/mysql/insert.sql b/workflow/engine/data/mysql/insert.sql index 4116c68ee..fc8dad492 100755 --- a/workflow/engine/data/mysql/insert.sql +++ b/workflow/engine/data/mysql/insert.sql @@ -61189,6 +61189,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','2014-01-15') , ( 'LABEL','ID_TABLE_NAME','en','Table Name','2014-01-15') , ( 'LABEL','ID_TABLE_NAME_IS_REQUIRED','en','Table Name is required.','2014-01-15') , +( 'LABEL','ID_TABLE_AND_PROCESS_NAME_ARE_REQUIRED','en','Table and Process Name are required.','2021-02-24') , ( 'LABEL','ID_TABLE_NAME_TOO_SHORT','en','The table name is too short, it should have at least 4 characters.','2014-01-15') , ( 'LABEL','ID_TABLE_NOT_EXIST_SKIPPED','en','Table does not exist... skipped!','2014-01-15') , ( 'LABEL','ID_TABLE_NOT_FOUND','en','Table Not found','2014-01-15') , diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index d9818702f..11cf5b182 100644 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -955,9 +955,6 @@ Ext.onReady(function () { }); var items = new Array(); - if (PRO_UID === false) { - items.push(processComboBox); - } items.push({ id: 'REP_TAB_NAME', @@ -974,6 +971,11 @@ Ext.onReady(function () { } } }); + + if (PRO_UID === false) { + items.push(processComboBox); + } + items.push({ id: 'REP_TAB_DSC', fieldLabel: _("ID_DESCRIPTION"), @@ -1115,6 +1117,19 @@ function createReportTable() var tableName = Ext.getCmp('REP_TAB_NAME').getValue().trim(); var tableDescription = Ext.getCmp('REP_TAB_DSC').getValue().trim(); + PRO_UID = (PRO_UID !== false && PRO_UID !== "") ? PRO_UID : ((Ext.getCmp('PROCESS').getValue().trim() != '') ? Ext.getCmp('PROCESS').getValue().trim() : ''); + + //validate table name and process + if (Ext.getCmp('REP_TAB_NAME').getValue().trim() == '' && PRO_UID == '') { + Ext.getCmp('PROCESS').focus(); + Ext.getCmp('REP_TAB_NAME').focus(); + PMExt.error(_('ID_ERROR'), _('ID_TABLE_AND_PROCESS_NAME_ARE_REQUIRED'), function () { + Ext.getCmp('PROCESS').focus(); + Ext.getCmp('REP_TAB_NAME').focus(); + }); + return false; + } + //validate table name if (Ext.getCmp('REP_TAB_NAME').getValue().trim() == '') { Ext.getCmp('REP_TAB_NAME').focus(); @@ -1125,7 +1140,6 @@ function createReportTable() } //validate process - PRO_UID = (PRO_UID !== false && PRO_UID !== "") ? PRO_UID : ((Ext.getCmp('PROCESS').getValue().trim() != '') ? Ext.getCmp('PROCESS').getValue().trim() : ''); if (PRO_UID == '') { Ext.getCmp('PROCESS').focus(); PMExt.error(_('ID_ERROR'), _('ID_PROCESS_IS_REQUIRED'), function () {