IDEMPIERE-4157: Quick Form for fast data entry with keyboard

This commit is contained in:
Deepak Pansheriya 2020-02-26 16:03:16 +05:30 committed by Carlos Ruiz
parent 8733f74809
commit 434cbaf110
41 changed files with 4715 additions and 92 deletions

View File

@ -1,5 +1,5 @@
CREATE OR REPLACE VIEW ad_field_v AS CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id

View File

@ -1,5 +1,5 @@
CREATE OR REPLACE VIEW ad_field_vt AS CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id

View File

@ -7,7 +7,7 @@ COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandator
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus,
c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id

View File

@ -6,7 +6,7 @@ CREATE OR REPLACE VIEW ad_field_vt AS
c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id

View File

@ -0,0 +1,206 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4157 Quick Form enhancement
-- Oct 31, 2017 5:12:27 PM IST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203142,0,0,'Y',TO_DATE('2017-10-31 17:12:26','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-31 17:12:26','YYYY-MM-DD HH24:MI:SS'),100,'IsQuickForm','Quick Form','Quick Form','D','3367c970-b5a2-47c8-86ad-efc08fd0a9f6')
;
-- Oct 31, 2017 5:13:45 PM IST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (213257,0,'Quick Form',107,'IsQuickForm','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_DATE('2017-10-31 17:13:44','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-31 17:13:44','YYYY-MM-DD HH24:MI:SS'),100,203142,'Y','N','D','N','N','N','Y','882bd1cb-1777-4824-9ace-f434d00e1722','Y',0,'N','N')
;
-- Oct 31, 2017 5:13:51 PM IST
ALTER TABLE AD_Field ADD IsQuickForm CHAR(1) DEFAULT 'N' CHECK (IsQuickForm IN ('Y','N')) NOT NULL
;
-- Oct 31, 2017 5:26:16 PM IST
UPDATE AD_Element SET Description='Display in Quick Form', Help='The field will be displayed in Quick Form for easy entry.',Updated=TO_DATE('2017-10-31 17:26:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=203142
;
-- Oct 31, 2017 5:26:16 PM IST
UPDATE AD_Column SET ColumnName='IsQuickForm', Name='Quick Form', Description='Display in Quick Form', Help='The field will be displayed in Quick Form for easy entry.' WHERE AD_Element_ID=203142
;
-- Oct 31, 2017 5:28:18 PM IST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (205244,'Quick Form','Display in Quick Form','The field will be displayed in Quick Form for easy entry.',107,213257,'Y',0,440,0,'N','N','N','N',0,0,'Y',TO_DATE('2017-10-31 17:28:17','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-31 17:28:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ada991db-87ad-45a3-8fd7-b8fefd16e50a','Y',420,1,1,1,'N','N','N')
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205244
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=133
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=137
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200274
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=138
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202362
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=142
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8343
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=140
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202341
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=141
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204213
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204214
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=420, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203500
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=430, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=440, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=450, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139
;
INSERT INTO AD_ToolBarButton (AD_Client_ID,AD_Org_ID,Created,CreatedBy,ComponentName,IsActive,AD_ToolBarButton_ID,Name,Updated,UpdatedBy,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_ToolBarButton_UU,Action,SeqNo,IsAdvancedButton,IsAddSeparator) VALUES (0,0,TO_DATE('2017-11-01 09:47:25','YYYY-MM-DD HH24:MI:SS'),100,'QuickForm','Y',200094,'Window -QuickForm',TO_DATE('2017-11-01 09:47:25','YYYY-MM-DD HH24:MI:SS'),100,'N',0,0,'73c01d0e-ff1b-4bbb-b3c7-e6c650adbed8','W',280,'N','Y')
;
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language = fgt.ad_language
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
LEFT JOIN ad_column_trl ct ON f.ad_column_id = ct.ad_column_id AND trl.ad_language = ct.ad_language
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
-- Nov 8, 2017 10:56:03 AM IST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (213259,0,'Quick Form','Display in Quick Form','The field will be displayed in Quick Form for easy encoding.',200008,'IsQuickForm','N',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_DATE('2017-11-08 10:56:02','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-11-08 10:56:02','YYYY-MM-DD HH24:MI:SS'),100,203142,'Y','N','D','N','N','N','Y','c52262c8-322a-4607-a50d-745a7f063706','Y',0,'N','N','N')
;
-- Nov 8, 2017 10:56:08 AM IST
ALTER TABLE AD_Tab_Customization ADD IsQuickForm CHAR(1) DEFAULT 'N' CHECK (IsQuickForm IN ('Y','N'))
;
-- Nov 9, 2017 10:55:12 AM IST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Quick Form',0,0,'Y',TO_DATE('2017-11-09 10:55:11','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-11-09 10:55:11','YYYY-MM-DD HH24:MI:SS'),100,200440,'QuickForm','D','0fadb3eb-413b-41c2-b41c-d0ae3a1d5c27')
;
-- Nov 21, 2017 11:39:03 AM IST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200112,0,0,TO_DATE('2017-11-21 11:39:02','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2017-11-21 11:39:02','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','QUICKFORM_PAGE_SIZE','25','Default paging size for Quick Form in zk webui','D','C','2ae2e737-285e-4cda-82a6-bbe7efce2cb8')
;
-- Quick Form enhancement
-- Nov 22, 2017 12:48:12 PM IST
INSERT INTO AD_ToolBarButton (AD_Client_ID,AD_Org_ID,Created,CreatedBy,ComponentName,IsActive,AD_ToolBarButton_ID,Name,Updated,UpdatedBy,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_ToolBarButton_UU,Action,SeqNo,IsAdvancedButton,IsAddSeparator) VALUES (0,0,TO_DATE('2017-11-22 12:48:11','YYYY-MM-DD HH24:MI:SS'),100,'QuickForm','Y',200095,'Detail - QuickForm',TO_DATE('2017-11-22 12:48:11','YYYY-MM-DD HH24:MI:SS'),100,'N',0,0,'93a9a483-ea2f-49b7-8737-a4113b2aa8de','D',50,'N','N')
;
-- Quick Form read only
-- Feb 18, 2020, 6:13:37 PM IST
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@AD_Column_ID.AD_Reference_ID@=200122 | @AD_Column_ID.AD_Reference_ID@=200127 | @AD_Column_ID.AD_Reference_ID@=200128 | @AD_Column_ID.AD_Reference_ID@=200161 | @AD_Column_ID.AD_Reference_ID@=200162 | @AD_Column_ID.AD_Reference_ID@=200163', IsToolbarButton=NULL,Updated=TO_DATE('2020-02-18 18:13:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205244
;
SELECT register_migration_script('201710311730_IDEMPIERE-4157.sql') FROM dual
;

View File

@ -0,0 +1,218 @@
-- IDEMPIERE-4157 Quick Form enhancement
-- Oct 31, 2017 5:12:27 PM IST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203142,0,0,'Y',TO_TIMESTAMP('2017-10-31 17:12:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-31 17:12:26','YYYY-MM-DD HH24:MI:SS'),100,'IsQuickForm','Quick Form','Quick Form','D','3367c970-b5a2-47c8-86ad-efc08fd0a9f6')
;
-- Oct 31, 2017 5:13:45 PM IST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (213257,0,'Quick Form',107,'IsQuickForm','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2017-10-31 17:13:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-31 17:13:44','YYYY-MM-DD HH24:MI:SS'),100,203142,'Y','N','D','N','N','N','Y','882bd1cb-1777-4824-9ace-f434d00e1722','Y',0,'N','N')
;
-- Oct 31, 2017 5:13:51 PM IST
ALTER TABLE AD_Field ADD COLUMN IsQuickForm CHAR(1) DEFAULT 'N' CHECK (IsQuickForm IN ('Y','N')) NOT NULL
;
-- Oct 31, 2017 5:26:16 PM IST
UPDATE AD_Element SET Description='Display in Quick Form', Help='The field will be displayed in Quick Form for easy entry.',Updated=TO_TIMESTAMP('2017-10-31 17:26:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=203142
;
-- Oct 31, 2017 5:26:16 PM IST
UPDATE AD_Column SET ColumnName='IsQuickForm', Name='Quick Form', Description='Display in Quick Form', Help='The field will be displayed in Quick Form for easy entry.' WHERE AD_Element_ID=203142
;
-- Oct 31, 2017 5:28:18 PM IST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (205244,'Quick Form','Display in Quick Form','The field will be displayed in Quick Form for easy entry.',107,213257,'Y',0,440,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2017-10-31 17:28:17','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-31 17:28:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ada991db-87ad-45a3-8fd7-b8fefd16e50a','Y',420,1,1,1,'N','N','N')
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205244
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=133
;
-- Oct 31, 2017 5:29:05 PM IST
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=137
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200274
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=138
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202362
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=142
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8343
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=140
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202341
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=141
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204213
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204214
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=420, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203500
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=430, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=440, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136
;
-- Oct 31, 2017 5:29:06 PM IST
UPDATE AD_Field SET SeqNo=450, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:29:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139
;
INSERT INTO AD_ToolBarButton (AD_Client_ID,AD_Org_ID,Created,CreatedBy,ComponentName,IsActive,AD_ToolBarButton_ID,Name,Updated,UpdatedBy,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_ToolBarButton_UU,"action",SeqNo,IsAdvancedButton,IsAddSeparator) VALUES (0,0,TO_TIMESTAMP('2017-11-01 09:47:25','YYYY-MM-DD HH24:MI:SS'),100,'QuickForm','Y',200094,'Window -QuickForm',TO_TIMESTAMP('2017-11-01 09:47:25','YYYY-MM-DD HH24:MI:SS'),100,'N',0,0,'73c01d0e-ff1b-4bbb-b3c7-e6c650adbed8','W',280,'N','Y')
;
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline,
f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable,
COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus,
c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(f.placeholder, c.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable,
c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id, COALESCE(trl.placeholder, ct.placeholder) AS placeholder, c.ishtml, f.isquickform
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
LEFT JOIN ad_column_trl ct ON f.ad_column_id = ct.ad_column_id AND trl.ad_language::text = ct.ad_language::text
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
-- Nov 8, 2017 10:56:03 AM IST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (213259,0,'Quick Form','Display in Quick Form','The field will be displayed in Quick Form for easy encoding.',200008,'IsQuickForm','N',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2017-11-08 10:56:02','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-11-08 10:56:02','YYYY-MM-DD HH24:MI:SS'),100,203142,'Y','N','D','N','N','N','Y','c52262c8-322a-4607-a50d-745a7f063706','Y',0,'N','N','N')
;
-- Nov 8, 2017 10:56:08 AM IST
ALTER TABLE AD_Tab_Customization ADD COLUMN IsQuickForm CHAR(1) DEFAULT 'N' CHECK (IsQuickForm IN ('Y','N'))
;
-- Nov 9, 2017 10:55:12 AM IST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Quick Form',0,0,'Y',TO_TIMESTAMP('2017-11-09 10:55:11','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-11-09 10:55:11','YYYY-MM-DD HH24:MI:SS'),100,200440,'QuickForm','D','0fadb3eb-413b-41c2-b41c-d0ae3a1d5c27')
;
-- Nov 21, 2017 11:39:03 AM IST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200112,0,0,TO_TIMESTAMP('2017-11-21 11:39:02','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2017-11-21 11:39:02','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','QUICKFORM_PAGE_SIZE','25','Default paging size for Quick Form in zk webui','D','C','2ae2e737-285e-4cda-82a6-bbe7efce2cb8')
;
-- Quick Form enhancement
-- Nov 22, 2017 12:48:12 PM IST
INSERT INTO AD_ToolBarButton (AD_Client_ID,AD_Org_ID,Created,CreatedBy,ComponentName,IsActive,AD_ToolBarButton_ID,Name,Updated,UpdatedBy,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_ToolBarButton_UU,"action",SeqNo,IsAdvancedButton,IsAddSeparator) VALUES (0,0,TO_TIMESTAMP('2017-11-22 12:48:11','YYYY-MM-DD HH24:MI:SS'),100,'QuickForm','Y',200095,'Detail - QuickForm',TO_TIMESTAMP('2017-11-22 12:48:11','YYYY-MM-DD HH24:MI:SS'),100,'N',0,0,'93a9a483-ea2f-49b7-8737-a4113b2aa8de','D',50,'N','N')
;
-- Quick Form read only
-- Feb 18, 2020, 6:13:37 PM IST
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@AD_Column_ID.AD_Reference_ID@=200122 | @AD_Column_ID.AD_Reference_ID@=200127 | @AD_Column_ID.AD_Reference_ID@=200128 | @AD_Column_ID.AD_Reference_ID@=200161 | @AD_Column_ID.AD_Reference_ID@=200162 | @AD_Column_ID.AD_Reference_ID@=200163', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-02-18 18:13:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205244
;
SELECT register_migration_script('201710311730_IDEMPIERE-4157.sql') FROM dual
;

View File

@ -5,6 +5,7 @@ import java.util.Properties;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.X_AD_Tab_Customization; import org.compiere.model.X_AD_Tab_Customization;
import org.compiere.util.Util;
public class MTabCustomization extends X_AD_Tab_Customization { public class MTabCustomization extends X_AD_Tab_Customization {
/** /**
@ -28,10 +29,60 @@ public class MTabCustomization extends X_AD_Tab_Customization {
/** /**
* *
* @param ctx * @param ctx
* @param AD_User_ID
* @param AD_Tab_ID * @param AD_Tab_ID
* @param trxName
*/ */
public static MTabCustomization get(Properties ctx, int AD_User_ID, int AD_Tab_ID, String trxName) { public static MTabCustomization get(Properties ctx, int AD_User_ID, int AD_Tab_ID, String trxName) {
Query query = new Query(ctx, Table_Name, "AD_User_ID=? AND AD_Tab_ID=?", trxName); return get(ctx, AD_User_ID, AD_Tab_ID, trxName, false);
return query.setClient_ID().setParameters(new Object[]{AD_User_ID, AD_Tab_ID}).first();
} }
/**
* @param ctx
* @param AD_User_ID
* @param AD_Tab_ID
* @param trxName
* @param isQuickForm
* @return
*/
public static MTabCustomization get(Properties ctx, int AD_User_ID, int AD_Tab_ID, String trxName, boolean isQuickForm) {
Query query = new Query(ctx, Table_Name, "AD_User_ID=? AND AD_Tab_ID=? AND IsQuickForm=?", trxName);
return query.setClient_ID().setParameters(new Object[] { AD_User_ID, AD_Tab_ID, (isQuickForm ? "Y" : "N") }).first();
}
/**
* Save Tab Customization Data
*
* @param ctx - Context
* @param AD_Tab_ID - Tab ID
* @param AD_User_ID - User ID
* @param Custom - Customized Field IDs with it's Size
* @param DisplayedGrid - Default preference of Grid view
* @param trxName - Transaction
* @param isQuickForm - Is Quick Form
* @return True if save successfully
*/
public static boolean saveData(Properties ctx, int AD_Tab_ID, int AD_User_ID, String Custom, String DisplayedGrid, String trxName, boolean isQuickForm) {
MTabCustomization tabCust = get(ctx, AD_User_ID, AD_Tab_ID, trxName, isQuickForm);
if (tabCust != null && tabCust.getAD_Tab_Customization_ID() > 0)
{
tabCust.setCustom(Custom);
tabCust.setIsDisplayedGrid(DisplayedGrid);
}
else
{
tabCust = new MTabCustomization(ctx, 0, trxName);
tabCust.setAD_Tab_ID(AD_Tab_ID);
tabCust.setAD_User_ID(AD_User_ID);
tabCust.setCustom(Custom);
tabCust.setIsDisplayedGrid(DisplayedGrid);
tabCust.setIsQuickForm(isQuickForm);
}
if (Util.isEmpty(tabCust.getCustom(), true))
return tabCust.delete(true);
return tabCust.save();
} // saveTabCustomization
} }

View File

@ -2595,6 +2595,13 @@ public class GridField
{ {
return m_lookupEditorSettingValue; return m_lookupEditorSettingValue;
} }
/**
* Is Quick Form
* @return true if displayed in Quick Form
*/
public boolean isQuickForm() {
return m_vo.IsQuickForm;
}
public void processUIVirtualColumn() { public void processUIVirtualColumn() {
String sql = m_vo.ColumnSQL.substring(5); String sql = m_vo.ColumnSQL.substring(5);

View File

@ -200,6 +200,8 @@ public class GridFieldVO implements Serializable
vo.AD_Reference_Value_ID = rs.getInt(i); vo.AD_Reference_Value_ID = rs.getInt(i);
else if (columnName.equalsIgnoreCase("ValidationCode")) else if (columnName.equalsIgnoreCase("ValidationCode"))
vo.ValidationCode = rs.getString(i); vo.ValidationCode = rs.getString(i);
else if (columnName.equalsIgnoreCase("IsQuickForm"))
vo.IsQuickForm = "Y".equals(rs.getString (i));
else if (columnName.equalsIgnoreCase("ColumnSQL")) { else if (columnName.equalsIgnoreCase("ColumnSQL")) {
vo.ColumnSQL = rs.getString(i); vo.ColumnSQL = rs.getString(i);
if (vo.ColumnSQL != null && !vo.ColumnSQL.startsWith("@SQL=") && !vo.ColumnSQL.startsWith("@SQLFIND=") && vo.ColumnSQL.contains("@")) { if (vo.ColumnSQL != null && !vo.ColumnSQL.startsWith("@SQL=") && !vo.ColumnSQL.startsWith("@SQLFIND=") && vo.ColumnSQL.contains("@")) {
@ -739,10 +741,15 @@ public class GridFieldVO implements Serializable
public int PA_DashboardContent_ID = 0; public int PA_DashboardContent_ID = 0;
public String Placeholder = ""; public String Placeholder = "";
public String Placeholder2 = ""; public String Placeholder2 = "";
/* Is HTML String */ /* Is HTML String */
public boolean IsHtml = false; public boolean IsHtml = false;
/* Allow to show field in Quick Form */
public boolean IsQuickForm = false;
/** /**
* Set Context including contained elements * Set Context including contained elements
* @param newCtx new context * @param newCtx new context
@ -879,6 +886,7 @@ public class GridFieldVO implements Serializable
clone.PA_DashboardContent_ID = PA_DashboardContent_ID; clone.PA_DashboardContent_ID = PA_DashboardContent_ID;
clone.Placeholder = Placeholder; clone.Placeholder = Placeholder;
clone.IsHtml = IsHtml; clone.IsHtml = IsHtml;
clone.IsQuickForm = IsQuickForm;
// Lookup // Lookup
clone.ValidationCode = ValidationCode; clone.ValidationCode = ValidationCode;

View File

@ -214,6 +214,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
//Contains currently selected rows //Contains currently selected rows
private ArrayList<Integer> selection = null; private ArrayList<Integer> selection = null;
public boolean isQuickForm = false;
// Context property names: // Context property names:
public static final String CTX_KeyColumnName = "_TabInfo_KeyColumnName"; public static final String CTX_KeyColumnName = "_TabInfo_KeyColumnName";
@ -3375,6 +3376,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
selection.clear(); selection.clear();
} }
public boolean isQuickForm() {
return isQuickForm;
}
public void setQuickForm(boolean isQuickForm) {
this.isQuickForm = isQuickForm;
}
public GridWindow getGridWindow() public GridWindow getGridWindow()
{ {
return this.m_window; return this.m_window;

View File

@ -904,7 +904,13 @@ public class GridTable extends AbstractTableModel
} }
if (getRowCount() == 0) if (getRowCount() == 0)
return; return;
GridField field = getField(col);
// Ignoring new record while sorting
if (field.getGridTab().isQuickForm())
dataIgnore();
boolean isSameSortEntries = (col == m_lastSortColumnIndex && ascending == m_lastSortedAscending); boolean isSameSortEntries = (col == m_lastSortColumnIndex && ascending == m_lastSortedAscending);
if (!isSameSortEntries) if (!isSameSortEntries)
{ {
@ -915,7 +921,6 @@ public class GridTable extends AbstractTableModel
//cache changed row //cache changed row
Object[] changedRow = m_rowChanged >= 0 ? getDataAtRow(m_rowChanged) : null; Object[] changedRow = m_rowChanged >= 0 ? getDataAtRow(m_rowChanged) : null;
GridField field = getField (col);
// RowIDs are not sorted // RowIDs are not sorted
if (field.getDisplayType() == DisplayType.RowID) if (field.getDisplayType() == DisplayType.RowID)
return; return;
@ -3976,4 +3981,12 @@ public class GridTable extends AbstractTableModel
public int getKeyColumnIndex() { public int getKeyColumnIndex() {
return m_indexKeyColumn; return m_indexKeyColumn;
} }
/**
* Index of updated row's
*/
public int getRowChanged()
{
return m_rowChanged;
}
} }

View File

@ -483,6 +483,19 @@ public interface I_AD_Field
/** Get Quick Entry */ /** Get Quick Entry */
public boolean isQuickEntry(); public boolean isQuickEntry();
/** Column name IsQuickForm */
public static final String COLUMNNAME_IsQuickForm = "IsQuickForm";
/** Set Quick Form.
* Display in Quick Form
*/
public void setIsQuickForm (boolean IsQuickForm);
/** Get Quick Form.
* Display in Quick Form
*/
public boolean isQuickForm();
/** Column name IsReadOnly */ /** Column name IsReadOnly */
public static final String COLUMNNAME_IsReadOnly = "IsReadOnly"; public static final String COLUMNNAME_IsReadOnly = "IsReadOnly";

View File

@ -157,6 +157,19 @@ public interface I_AD_Tab_Customization
/** Get Show in Grid */ /** Get Show in Grid */
public String getIsDisplayedGrid(); public String getIsDisplayedGrid();
/** Column name IsQuickForm */
public static final String COLUMNNAME_IsQuickForm = "IsQuickForm";
/** Set Quick Form.
* Display in Quick Form
*/
public void setIsQuickForm (boolean IsQuickForm);
/** Get Quick Form.
* Display in Quick Form
*/
public boolean isQuickForm();
/** Column name Updated */ /** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated"; public static final String COLUMNNAME_Updated = "Updated";

View File

@ -194,6 +194,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String ZK_THEME_USE_FONT_ICON_FOR_IMAGE = "ZK_THEME_USE_FONT_ICON_FOR_IMAGE"; public static final String ZK_THEME_USE_FONT_ICON_FOR_IMAGE = "ZK_THEME_USE_FONT_ICON_FOR_IMAGE";
public static final String ZK_THEME = "ZK_THEME"; public static final String ZK_THEME = "ZK_THEME";
public static final String ZOOM_ACROSS_QUERY_TIMEOUT = "ZOOM_ACROSS_QUERY_TIMEOUT"; public static final String ZOOM_ACROSS_QUERY_TIMEOUT = "ZOOM_ACROSS_QUERY_TIMEOUT";
public static final String QUICKFORM_PAGE_SIZE = "QUICKFORM_PAGE_SIZE";
/** /**
* Standard Constructor * Standard Constructor

View File

@ -32,7 +32,7 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20191121L; private static final long serialVersionUID = 20200225L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName) public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName)
@ -55,6 +55,8 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
setIsFieldOnly (false); setIsFieldOnly (false);
setIsHeading (false); setIsHeading (false);
setIsQuickEntry (false); setIsQuickEntry (false);
// N
setIsQuickForm (false);
// N // N
setIsReadOnly (false); setIsReadOnly (false);
setIsSameLine (false); setIsSameLine (false);
@ -783,6 +785,30 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return false; return false;
} }
/** Set Quick Form.
@param IsQuickForm
Display in Quick Form
*/
public void setIsQuickForm (boolean IsQuickForm)
{
set_Value (COLUMNNAME_IsQuickForm, Boolean.valueOf(IsQuickForm));
}
/** Get Quick Form.
@return Display in Quick Form
*/
public boolean isQuickForm ()
{
Object oo = get_Value(COLUMNNAME_IsQuickForm);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Read Only. /** Set Read Only.
@param IsReadOnly @param IsReadOnly
Field is read only Field is read only

View File

@ -29,7 +29,7 @@ public class X_AD_Tab_Customization extends PO implements I_AD_Tab_Customization
/** /**
* *
*/ */
private static final long serialVersionUID = 20191121L; private static final long serialVersionUID = 20200225L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Tab_Customization (Properties ctx, int AD_Tab_Customization_ID, String trxName) public X_AD_Tab_Customization (Properties ctx, int AD_Tab_Customization_ID, String trxName)
@ -194,4 +194,28 @@ public class X_AD_Tab_Customization extends PO implements I_AD_Tab_Customization
{ {
return (String)get_Value(COLUMNNAME_IsDisplayedGrid); return (String)get_Value(COLUMNNAME_IsDisplayedGrid);
} }
/** Set Quick Form.
@param IsQuickForm
Display in Quick Form
*/
public void setIsQuickForm (boolean IsQuickForm)
{
set_Value (COLUMNNAME_IsQuickForm, Boolean.valueOf(IsQuickForm));
}
/** Get Quick Form.
@return Display in Quick Form
*/
public boolean isQuickForm ()
{
Object oo = get_Value(COLUMNNAME_IsQuickForm);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
} }

View File

@ -250,7 +250,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
keyListener = new Keylistener(); keyListener = new Keylistener();
keyListener.setPage(this.getPage()); keyListener.setPage(this.getPage());
keyListener.setCtrlKeys("@a@c@d@e@f@h@m@n@o@p@r@s@t@z@x@#left@#right@#up@#down@#home@#end#enter^u@u@#pgdn@#pgup"); keyListener.setCtrlKeys("@a@c@d@e@f@h@l@m@n@o@p@r@s@t@z@x@#left@#right@#up@#down@#home@#end#enter^u@u@#pgdn@#pgup$#f2^#f2");
keyListener.setAutoBlur(false); keyListener.setAutoBlur(false);
//create new desktop //create new desktop

View File

@ -1036,5 +1036,11 @@ public class ADSortTab extends Panel implements IADTabpanel
public ADTreePanel getTreePanel() { public ADTreePanel getTreePanel() {
return null; return null;
} }
@Override
public boolean isEnableQuickFormButton()
{
return false;
}
} //ADSortTab } //ADSortTab

View File

@ -84,6 +84,7 @@ import org.compiere.model.PO;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.X_AD_FieldGroup; import org.compiere.model.X_AD_FieldGroup;
import org.compiere.model.X_AD_ToolBarButton; import org.compiere.model.X_AD_ToolBarButton;
import org.compiere.util.CCache;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -214,6 +215,8 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
private static final String DEFAULT_PANEL_WIDTH = "300px"; private static final String DEFAULT_PANEL_WIDTH = "300px";
private static CCache<Integer, Boolean> quickFormCache = new CCache<Integer, Boolean>(null, "QuickForm", 20, false);
private static enum SouthEvent { private static enum SouthEvent {
SLIDE(), SLIDE(),
OPEN(), OPEN(),
@ -2009,4 +2012,29 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
} }
@Override
public boolean isEnableQuickFormButton()
{
boolean hasQuickForm = false;
int tabID = getGridTab().getAD_Tab_ID();
if (quickFormCache.containsKey(tabID))
{
hasQuickForm = quickFormCache.get(tabID);
}
else if (getGridTab() != null)
{
for (GridField field : getGridTab().getFields())
{
if (field.isQuickForm())
{
hasQuickForm = true;
break;
}
}
quickFormCache.put(tabID, hasQuickForm);
}
return hasQuickForm;
}
} }

View File

@ -119,6 +119,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
private ToolBarButton btnProcess; private ToolBarButton btnProcess;
private ToolBarButton btnQuickForm;
private ToolBarButton btnShowMore; private ToolBarButton btnShowMore;
private Menupopup menupopup; private Menupopup menupopup;
@ -148,6 +150,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
private long prevKeyEventTime = 0; private long prevKeyEventTime = 0;
private KeyEvent prevKeyEvent; private KeyEvent prevKeyEvent;
// Maintain hierarchical Quick form by its parent-child tab while open leaf
// tab once & dispose and doing same action
private int quickFormTabHrchyLevel = 0;
private A overflowButton; private A overflowButton;
@ -235,6 +241,9 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnProcess.setTooltiptext(btnProcess.getTooltiptext()+ " Alt+O"); btnProcess.setTooltiptext(btnProcess.getTooltiptext()+ " Alt+O");
btnProcess.setDisabled(false); btnProcess.setDisabled(false);
btnQuickForm = createButton("QuickForm", "QuickForm", "QuickForm");
btnQuickForm.setDisabled(false);
// Help and Exit should always be enabled // Help and Exit should always be enabled
btnHelp.setDisabled(false); btnHelp.setDisabled(false);
btnGridToggle.setDisabled(false); btnGridToggle.setDisabled(false);
@ -440,6 +449,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
altKeyMap.put(VK_R, btnReport); altKeyMap.put(VK_R, btnReport);
altKeyMap.put(VK_P, btnPrint); altKeyMap.put(VK_P, btnPrint);
altKeyMap.put(VK_O, btnProcess); altKeyMap.put(VK_O, btnProcess);
altKeyMap.put(VK_L, btnCustomize);
} }
protected void addSeparator() protected void addSeparator()
@ -476,6 +486,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
} else if (eventName.equals(Events.ON_CTRL_KEY)) } else if (eventName.equals(Events.ON_CTRL_KEY))
{ {
KeyEvent keyEvent = (KeyEvent) event; KeyEvent keyEvent = (KeyEvent) event;
if (SessionManager.getOpenQuickFormTabs().size() > 0 && !(keyEvent.getKeyCode() == KeyEvent.F2))
return;
if (LayoutUtils.isReallyVisible(this)) { if (LayoutUtils.isReallyVisible(this)) {
//filter same key event that is too close //filter same key event that is too close
//firefox fire key event twice when grid is visible //firefox fire key event twice when grid is visible
@ -672,6 +684,12 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
menuItems.get(button).setDisabled(!enabled); menuItems.get(button).setDisabled(!enabled);
} }
public void enableQuickForm(boolean enabled)
{
btnQuickForm.setDisabled(!enabled);
enableMenuitem(btnQuickForm, enabled);
}
public void lock(boolean locked) public void lock(boolean locked)
{ {
setPressed("Lock", locked); setPressed("Lock", locked);
@ -734,10 +752,41 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
} }
} }
else if (!keyEvent.isAltKey() && keyEvent.isCtrlKey() && !keyEvent.isShiftKey()) else if (!keyEvent.isAltKey() && keyEvent.isCtrlKey() && !keyEvent.isShiftKey())
btn = ctrlKeyMap.get(keyEvent.getKeyCode()); {
if (keyEvent.getKeyCode() == KeyEvent.F2)
{
quickFormTabHrchyLevel = quickFormTabHrchyLevel + 1;
fireButtonClickEvent(keyEvent, btnDetailRecord);
if (!btnQuickForm.isDisabled() && btnQuickForm.isVisible())
{
fireButtonClickEvent(keyEvent, btnQuickForm);
}
else if (!btnParentRecord.isDisabled() && btnParentRecord.isVisible())
{
fireButtonClickEvent(keyEvent, btnParentRecord);
quickFormTabHrchyLevel = quickFormTabHrchyLevel - 1;
}
return;
}
else
{
btn = ctrlKeyMap.get(keyEvent.getKeyCode());
}
}
else if (!keyEvent.isAltKey() && !keyEvent.isCtrlKey() && !keyEvent.isShiftKey()) else if (!keyEvent.isAltKey() && !keyEvent.isCtrlKey() && !keyEvent.isShiftKey())
btn = keyMap.get(keyEvent.getKeyCode()); btn = keyMap.get(keyEvent.getKeyCode());
else if (!keyEvent.isAltKey() && !keyEvent.isCtrlKey() && keyEvent.isShiftKey())
{
if (keyEvent.getKeyCode() == KeyEvent.F2)
{
btn = btnQuickForm;
}
}
fireButtonClickEvent(keyEvent, btn);
}
private void fireButtonClickEvent(KeyEvent keyEvent, ToolBarButton btn)
{
if (btn != null) { if (btn != null) {
prevKeyEventTime = System.currentTimeMillis(); prevKeyEventTime = System.currentTimeMillis();
prevKeyEvent = keyEvent; prevKeyEvent = keyEvent;
@ -1107,4 +1156,20 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
} }
} }
} }
/**
* @return
*/
public int getQuickFormTabHrchyLevel()
{
return quickFormTabHrchyLevel;
}
/**
* @param quickFormHrchyTabLevel
*/
public void setQuickFormTabHrchyLevel(int quickFormHrchyTabLevel)
{
this.quickFormTabHrchyLevel = quickFormHrchyTabLevel;
}
} }

View File

@ -49,6 +49,7 @@ import org.adempiere.webui.apps.HelpWindow;
import org.adempiere.webui.apps.ProcessModalDialog; import org.adempiere.webui.apps.ProcessModalDialog;
import org.adempiere.webui.apps.form.WCreateFromFactory; import org.adempiere.webui.apps.form.WCreateFromFactory;
import org.adempiere.webui.apps.form.WCreateFromWindow; import org.adempiere.webui.apps.form.WCreateFromWindow;
import org.adempiere.webui.apps.form.WQuickForm;
import org.adempiere.webui.component.Mask; import org.adempiere.webui.component.Mask;
import org.adempiere.webui.component.ProcessInfoDialog; import org.adempiere.webui.component.ProcessInfoDialog;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
@ -198,6 +199,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
private MImage image; private MImage image;
/**
* Quick Form Status bar
*/
protected StatusBar statusBarQF;
/** /**
* Constructor * Constructor
* @param ctx * @param ctx
@ -1100,6 +1106,42 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
/**
* Invoke when quick form is click
*/
public void onQuickForm()
{
logger.log(Level.FINE, "Invoke Quick Form");
// Prevent to open Quick Form if already opened.
if (!SessionManager.registerQuickFormTab(getADTab().getSelectedGridTab().getAD_Tab_ID()))
{
logger.fine("TabID=" + getActiveGridTab().getAD_Tab_ID() + " is already open.");
return;
}
int table_ID = adTabbox.getSelectedGridTab().getAD_Table_ID();
if (table_ID == -1)
return;
statusBarQF = new StatusBar();
// Remove Key-listener of parent Quick Form
int tabLevel = getToolbar().getQuickFormTabHrchyLevel();
if (tabLevel > 0 && getCurrQGV() != null)
{
SessionManager.getSessionApplication().getKeylistener().removeEventListener(Events.ON_CTRL_KEY, getCurrQGV());
}
WQuickForm form = new WQuickForm(this, m_onlyCurrentRows, m_onlyCurrentDays);
form.setTitle(this.getADTab().getSelectedGridTab().getName());
form.setVisible(true);
form.setSizable(true);
form.setMaximizable(true);
form.setMaximized(true);
form.setPosition("center");
ZkCssHelper.appendStyle(form, "min-width: 500px; min-height: 400px; width: 900px; height:550px; z-index: 900;");
AEnv.showWindow(form);
} // onQuickForm
/** /**
* @param event * @param event
* @see EventListener#onEvent(Event) * @see EventListener#onEvent(Event)
@ -1149,11 +1191,30 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
hideBusyMask(); hideBusyMask();
ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget(); ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget();
onModalClose(dialog.getProcessInfo()); onModalClose(dialog.getProcessInfo());
String s = statusBar.getStatusLine(); String s = null;
boolean b = statusBar.getStatusError(); boolean b = false;
ProcessInfoLog[] logs = statusBar.getPLogs(); ProcessInfoLog[] logs = null;
onRefresh(true, false); if (getActiveGridTab().isQuickForm)
statusBar.setStatusLine(s, b, logs); {
s = statusBarQF.getStatusLine();
b = statusBarQF.getStatusError();
logs = statusBarQF.getPLogs();
}
else
{
s = statusBar.getStatusLine();
b = statusBar.getStatusError();
logs = statusBar.getPLogs();
}
onRefresh(true, false);
if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(s, b, logs);
}
else
{
statusBar.setStatusLine(s, b, logs);
}
} }
else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName())) else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName()))
{ {
@ -1351,6 +1412,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew()); toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew());
toolbar.enableQuickForm(adTabbox.getSelectedTabpanel().isEnableQuickFormButton() && !adTabbox.getSelectedGridTab().isReadOnly());
boolean isNewRow = adTabbox.getSelectedGridTab().getRowCount() == 0 || adTabbox.getSelectedGridTab().isNew(); boolean isNewRow = adTabbox.getSelectedGridTab().getRowCount() == 0 || adTabbox.getSelectedGridTab().isNew();
//Deepak-Enabling customize button IDEMPIERE-364 //Deepak-Enabling customize button IDEMPIERE-364
if(adTabbox.getSelectedTabpanel() instanceof ADSortTab){//consistent with dataStatusChanged if(adTabbox.getSelectedTabpanel() instanceof ADSortTab){//consistent with dataStatusChanged
@ -1466,9 +1529,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (detailTab) { if (detailTab) {
String msg = e.getTotalRows() + " " + Msg.getMsg(Env.getCtx(), "Records"); String msg = e.getTotalRows() + " " + Msg.getMsg(Env.getCtx(), "Records");
adTabbox.setDetailPaneStatusMessage(msg, false); adTabbox.setDetailPaneStatusMessage(msg, false);
} else { } else {
statusBar.setStatusLine ("", false); if (getActiveGridTab().isQuickForm)
} {
statusBarQF.setStatusLine("", false);
}
else
{
statusBar.setStatusLine("", false);
}
}
} }
else else
{ {
@ -1541,7 +1611,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (detailTab) { if (detailTab) {
adTabbox.setDetailPaneStatusMessage(sb.toString (), e.isError ()); adTabbox.setDetailPaneStatusMessage(sb.toString (), e.isError ());
} else { } else {
statusBar.setStatusLine (sb.toString (), e.isError ()); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(sb.toString(), e.isError());
}
else
{
statusBar.setStatusLine(sb.toString(), e.isError());
}
} }
} }
} }
@ -2192,14 +2269,28 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
if (result) if (result)
{ {
String statusLine = statusBar.getStatusLine(); String statusLine = null;
adTabbox.getSelectedGridTab().dataRefreshAll(true, true); if (getActiveGridTab().isQuickForm)
adTabbox.getSelectedGridTab().refreshParentTabs(); {
statusBar.setStatusLine(statusLine); statusLine = statusBarQF.getStatusLine();
if( adTabbox.getSelectedDetailADTabpanel() != null && }
adTabbox.getSelectedDetailADTabpanel().getGridTab() != null ) else
adTabbox.getSelectedDetailADTabpanel().getGridTab().dataRefreshAll(true, true); {
} statusLine = statusBar.getStatusLine();
}
adTabbox.getSelectedGridTab().dataRefreshAll(true, true);
adTabbox.getSelectedGridTab().refreshParentTabs();
if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(statusLine);
}
else
{
statusBar.setStatusLine(statusLine);
}
if (adTabbox.getSelectedDetailADTabpanel() != null && adTabbox.getSelectedDetailADTabpanel().getGridTab() != null)
adTabbox.getSelectedDetailADTabpanel().getGridTab().dataRefreshAll(true, true);
}
if (dirtyTabpanel != null) { if (dirtyTabpanel != null) {
if (dirtyTabpanel == adTabbox.getSelectedDetailADTabpanel()) if (dirtyTabpanel == adTabbox.getSelectedDetailADTabpanel())
Clients.scrollIntoView(dirtyTabpanel); Clients.scrollIntoView(dirtyTabpanel);
@ -2207,6 +2298,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} else { } else {
focusToActivePanel(); focusToActivePanel();
} }
if(adTabbox.getSelectedGridTab().isQuickForm())
onRefresh(true, true);
} }
}); });
} }
@ -2317,9 +2411,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} else if (dirtyTabpanel instanceof ADSortTab) { } else if (dirtyTabpanel instanceof ADSortTab) {
ADSortTab sortTab = (ADSortTab) dirtyTabpanel; ADSortTab sortTab = (ADSortTab) dirtyTabpanel;
if (!sortTab.isChanged()) { if (!sortTab.isChanged()) {
if (sortTab == adTabbox.getSelectedTabpanel()) { if (sortTab == adTabbox.getSelectedTabpanel()) {
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Saved")); if (getActiveGridTab().isQuickForm)
} else { {
statusBarQF.setStatusLine(Msg.getMsg(Env.getCtx(), "Saved"));
}
else
{
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Saved"));
}
} else {
adTabbox.setDetailPaneStatusMessage(Msg.getMsg(Env.getCtx(), "Saved"), false); adTabbox.setDetailPaneStatusMessage(Msg.getMsg(Env.getCtx(), "Saved"), false);
} }
} }
@ -2382,7 +2483,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
String msg = CLogger.retrieveErrorString(null); String msg = CLogger.retrieveErrorString(null);
if (msg != null) if (msg != null)
{ {
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), msg), true); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(Msg.getMsg(Env.getCtx(), msg), true);
}
else
{
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), msg), true);
}
} }
//other error will be catch in the dataStatusChanged event //other error will be catch in the dataStatusChanged event
} }
@ -2526,14 +2634,28 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
adTabbox.getSelectedGridTab().refreshParentTabs(); adTabbox.getSelectedGridTab().refreshParentTabs();
adTabbox.getSelectedTabpanel().dynamicDisplay(0); adTabbox.getSelectedTabpanel().dynamicDisplay(0);
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Deleted")+": "+count, false); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(Msg.getMsg(Env.getCtx(), "Deleted") + ": " + count, false);
}
else
{
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Deleted") + ": " + count, false);
}
} }
if (postCallback != null) if (postCallback != null)
postCallback.onCallback(result); postCallback.onCallback(result);
} }
}); });
} else { } else {
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Selected")+": 0", false); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(Msg.getMsg(Env.getCtx(), "Selected") + ": 0", false);
}
else
{
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Selected") + ": 0", false);
}
if (postCallback != null) if (postCallback != null)
postCallback.onCallback(false); postCallback.onCallback(false);
} }
@ -2824,7 +2946,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
*/ */
private void actionButton0 (String col, final IProcessButton wButton) private void actionButton0 (String col, final IProcessButton wButton)
{ {
final IADTabpanel adtabPanel = findADTabpanel(wButton); //To perform button action (adtabPanel is null in QuickForm)
IADTabpanel adtabPanel = null;
if (adTabbox.getSelectedGridTab().isQuickForm())
{
adtabPanel=this.getADTab().getSelectedTabpanel();
}
else
{
adtabPanel = findADTabpanel(wButton);
}
boolean startWOasking = false; boolean startWOasking = false;
if (adtabPanel == null) { if (adtabPanel == null) {
return; return;
@ -2986,7 +3117,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
onRefresh(true, false); onRefresh(true, false);
if (error != null) if (error != null)
statusBar.setStatusLine(error, true); {
if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(error, true);
}
else
{
statusBar.setStatusLine(error, true);
}
}
} }
} }
}); });
@ -3077,7 +3217,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
ProcessInfo pi = new ProcessInfo (title, wButton.getProcess_ID(), table_ID, record_ID); ProcessInfo pi = new ProcessInfo (title, wButton.getProcess_ID(), table_ID, record_ID);
pi.setAD_User_ID (Env.getAD_User_ID(ctx)); pi.setAD_User_ID (Env.getAD_User_ID(ctx));
pi.setAD_Client_ID (Env.getAD_Client_ID(ctx)); pi.setAD_Client_ID (Env.getAD_Client_ID(ctx));
final IADTabpanel adtabPanel = findADTabpanel(wButton); IADTabpanel adtabPanel = null;
if (adTabbox.getSelectedGridTab().isQuickForm())
{
adtabPanel=this.getADTab().getSelectedTabpanel();
}
else
{
adtabPanel = findADTabpanel(wButton);
}
GridTab gridTab = null; GridTab gridTab = null;
if (adtabPanel != null) if (adtabPanel != null)
gridTab = adtabPanel.getGridTab(); gridTab = adtabPanel.getGridTab();
@ -3105,7 +3253,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
else else
{ {
final IADTabpanel adtabPanel = findADTabpanel(wButton); IADTabpanel adtabPanel = null;
if (adTabbox.getSelectedGridTab().isQuickForm())
adtabPanel = this.getADTab().getSelectedTabpanel();
else
adtabPanel = findADTabpanel(wButton);
ProcessInfo pi = new ProcessInfo("", wButton.getProcess_ID(), table_ID, record_ID); ProcessInfo pi = new ProcessInfo("", wButton.getProcess_ID(), table_ID, record_ID);
if (adtabPanel != null && adtabPanel.isGridView() && adtabPanel.getGridTab() != null) if (adtabPanel != null && adtabPanel.isGridView() && adtabPanel.getGridTab() != null)
@ -3144,6 +3296,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
dialog.focus(); dialog.focus();
} }
if (adTabbox.getSelectedGridTab().isQuickForm()) {
adTabbox.getSelectedGridTab().dataRefreshAll(false, false);
}
else else
{ {
onRefresh(true, false); onRefresh(true, false);
@ -3162,7 +3317,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
String error = processButtonCallout((IProcessButton) event.getSource()); String error = processButtonCallout((IProcessButton) event.getSource());
if (error != null && error.trim().length() > 0) if (error != null && error.trim().length() > 0)
{ {
statusBar.setStatusLine(error, true); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(error, true);
}
else
{
statusBar.setStatusLine(error, true);
}
return; return;
} }
actionButton((IProcessButton) event.getSource()); actionButton((IProcessButton) event.getSource());
@ -3187,7 +3349,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
*/ */
private String processButtonCallout (IProcessButton button) private String processButtonCallout (IProcessButton button)
{ {
IADTabpanel adtab = findADTabpanel(button); IADTabpanel adtab = null;
if (adTabbox.getSelectedGridTab().isQuickForm())
{
adtab=this.getADTab().getSelectedTabpanel();
}
else
{
adtab = findADTabpanel(button);
}
if (adtab != null) { if (adtab != null) {
GridField field = adtab.getGridTab().getField(button.getColumnName()); GridField field = adtab.getGridTab().getField(button.getColumnName());
if (field != null) if (field != null)
@ -3280,7 +3450,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
// Get Log Info // Get Log Info
ProcessInfoUtil.setLogFromDB(pi); ProcessInfoUtil.setLogFromDB(pi);
ProcessInfoLog m_logs[] = pi.getLogs(); ProcessInfoLog m_logs[] = pi.getLogs();
statusBar.setStatusLine(pi.getSummary(), pi.isError(),m_logs); if (getActiveGridTab().isQuickForm)
{
statusBarQF.setStatusLine(pi.getSummary(), pi.isError(), m_logs);
}
else
{
statusBar.setStatusLine(pi.getSummary(), pi.isError(), m_logs);
}
if (m_logs != null && m_logs.length > 0) { if (m_logs != null && m_logs.length > 0) {
ProcessInfoDialog.showProcessInfo(pi, curWindowNo, getComponent(), false); ProcessInfoDialog.showProcessInfo(pi, curWindowNo, getComponent(), false);
@ -3332,7 +3510,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
gridFieldIds.add(fields[i].getAD_Field_ID()); gridFieldIds.add(fields[i].getAD_Field_ID());
} }
CustomizeGridViewDialog.showCustomize(0, adTabbox.getSelectedGridTab().getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView()); CustomizeGridViewDialog.showCustomize(0, adTabbox.getSelectedGridTab().getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView(), null, false);
} }
/** /**
@ -3405,5 +3583,34 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
Env.setContext(ctx, curWindowNo, "Name", ""); Env.setContext(ctx, curWindowNo, "Name", "");
} }
} }
/**
* @return Quick Form StatusBar
*/
public StatusBar getStatusBarQF()
{
return statusBarQF;
}
/**
* Implementation to work key listener for the current open Quick Form.
*/
QuickGridView currQGV = null;
/**
* @return
*/
public QuickGridView getCurrQGV()
{
return currQGV;
}
/**
* @param currQGV
*/
public void setCurrQGV(QuickGridView currQGV)
{
this.currQGV = currQGV;
}
} }

View File

@ -156,6 +156,26 @@ public class CompositeADTabbox extends AbstractADTabbox
else if (DetailPane.ON_DELETE_EVENT.equals(event.getName())) { else if (DetailPane.ON_DELETE_EVENT.equals(event.getName())) {
onDelete(); onDelete();
} }
else if (DetailPane.ON_QUICK_FORM_EVENT.equals(event.getName()))
{
if (headerTab.getGridTab().isNew() && !headerTab.needSave(true, false))
return;
final int row = getSelectedDetailADTabpanel() != null ? getSelectedDetailADTabpanel().getGridTab().getCurrentRow() : 0;
final boolean formView = event.getData() != null ? (Boolean) event.getData() : true;
adWindowPanel.saveAndNavigate(new Callback <Boolean>() {
@Override
public void onCallback(Boolean result)
{
if (result)
{
onEditDetail(row, formView);
adWindowPanel.onQuickForm();
}
}
});
}
} }
private void onDelete() { private void onDelete() {

View File

@ -69,6 +69,8 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
private static final String BTN_NEW_ID = "BtnNew"; private static final String BTN_NEW_ID = "BtnNew";
private static final String BTN_SAVE_ID = "BtnSave"; private static final String BTN_SAVE_ID = "BtnSave";
private static final String BTN_QUICK_FORM_ID = "BtnQuickForm";
private static final String TABBOX_ONSELECT_ATTRIBUTE = "detailpane.tabbox.onselect"; private static final String TABBOX_ONSELECT_ATTRIBUTE = "detailpane.tabbox.onselect";
@ -83,6 +85,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
private static final String NEW_IMAGE = "images/New16.png"; private static final String NEW_IMAGE = "images/New16.png";
private static final String PROCESS_IMAGE = "images/Process16.png"; private static final String PROCESS_IMAGE = "images/Process16.png";
private static final String SAVE_IMAGE = "images/Save16.png"; private static final String SAVE_IMAGE = "images/Save16.png";
private static final String QUICK_FORM_IMAGE = "images/QuickForm16.png";
private ToolBarButton btnNew; private ToolBarButton btnNew;
@ -111,6 +114,8 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
public static final String ON_SAVE_EVENT = "onSave"; public static final String ON_SAVE_EVENT = "onSave";
public static final String ON_QUICK_FORM_EVENT = "onQuickForm";
private HashMap<String, ToolBarButton> buttons = new HashMap<String, ToolBarButton>(); private HashMap<String, ToolBarButton> buttons = new HashMap<String, ToolBarButton>();
private List<ToolbarCustomButton> toolbarCustomButtons = new ArrayList<ToolbarCustomButton>(); private List<ToolbarCustomButton> toolbarCustomButtons = new ArrayList<ToolbarCustomButton>();
@ -355,6 +360,24 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
buttons.put(BTN_PROCESS_ID.substring(3, BTN_PROCESS_ID.length()), button); buttons.put(BTN_PROCESS_ID.substring(3, BTN_PROCESS_ID.length()), button);
} }
// ADD Quick Form Button
button = new ToolBarButton();
if (ThemeManager.isUseFontIconForImage())
button.setIconSclass("z-icon-QuickForm");
else
button.setImage(ThemeManager.getThemeResource(QUICK_FORM_IMAGE));
button.setId(BTN_QUICK_FORM_ID);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception
{
Event openEvent = new Event(ON_QUICK_FORM_EVENT, DetailPane.this);
eventListener.onEvent(openEvent);
}
});
button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "QuickForm")));
buttons.put(BTN_QUICK_FORM_ID.substring(3, BTN_QUICK_FORM_ID.length()), button);
MToolBarButton[] officialButtons = MToolBarButton.getToolbarButtons("D", null); MToolBarButton[] officialButtons = MToolBarButton.getToolbarButtons("D", null);
for (MToolBarButton toolbarButton : officialButtons) { for (MToolBarButton toolbarButton : officialButtons) {
if ( !toolbarButton.isActive() ) { if ( !toolbarButton.isActive() ) {
@ -711,7 +734,10 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
btn.setDisabled(false); btn.setDisabled(false);
} else if (BTN_SAVE_ID.equals(btn.getId())) { } else if (BTN_SAVE_ID.equals(btn.getId())) {
btn.setDisabled(!adtab.needSave(true, false)); btn.setDisabled(!adtab.needSave(true, false));
} }
else if (BTN_QUICK_FORM_ID.equals(btn.getId())) {
btn.setDisabled(!(adtab.isEnableQuickFormButton() && !adtab.getGridTab().isReadOnly()));
}
if (windowRestrictList.contains(btn.getId())) { if (windowRestrictList.contains(btn.getId())) {
btn.setVisible(false); btn.setVisible(false);
} else if (tabRestrictList.contains(btn.getId())) { } else if (tabRestrictList.contains(btn.getId())) {

View File

@ -84,7 +84,7 @@ public class GridView extends Vlayout implements EventListener<Event>, IdSpace,
private static final int DEFAULT_DETAIL_PAGE_SIZE = 10; private static final int DEFAULT_DETAIL_PAGE_SIZE = 10;
private static final int DEFAULT_MOBILE_PAGE_SIZE = 20; public static final int DEFAULT_MOBILE_PAGE_SIZE = 20;
private static final int DEFAULT_PAGE_SIZE = 20; private static final int DEFAULT_PAGE_SIZE = 20;
@ -163,7 +163,7 @@ public class GridView extends Vlayout implements EventListener<Event>, IdSpace,
//default paging size //default paging size
if (ClientInfo.isMobile()) if (ClientInfo.isMobile())
{ {
//Shoud be <= 20 on mobile //Should be <= 20 on mobile
pageSize = MSysConfig.getIntValue(MSysConfig.ZK_MOBILE_PAGING_SIZE, DEFAULT_MOBILE_PAGE_SIZE, Env.getAD_Client_ID(Env.getCtx())); pageSize = MSysConfig.getIntValue(MSysConfig.ZK_MOBILE_PAGING_SIZE, DEFAULT_MOBILE_PAGE_SIZE, Env.getAD_Client_ID(Env.getCtx()));
String limit = Library.getProperty(CustomGridDataLoader.GRID_DATA_LOADER_LIMIT); String limit = Library.getProperty(CustomGridDataLoader.GRID_DATA_LOADER_LIMIT);
if (limit == null || !(limit.equals(Integer.toString(pageSize)))) { if (limit == null || !(limit.equals(Integer.toString(pageSize)))) {

View File

@ -191,4 +191,8 @@ public interface IADTabpanel extends Component, Evaluatee {
*/ */
public abstract ADTreePanel getTreePanel(); public abstract ADTreePanel getTreePanel();
/**
* @return Quick Form Button Enabled/Disabled
*/
public abstract boolean isEnableQuickFormButton();
} }

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
package org.adempiere.webui.adwindow; package org.adempiere.webui.adwindow;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.form.WQuickForm;
import org.adempiere.webui.component.DocumentLink; import org.adempiere.webui.component.DocumentLink;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
@ -243,7 +244,9 @@ public class StatusBar extends Panel implements EventListener<Event>
while (parent != null) { while (parent != null) {
if (parent instanceof Tabpanel) if (parent instanceof Tabpanel)
return parent; return parent;
else if (parent instanceof WQuickForm)
return parent;
parent = parent.getParent(); parent = parent.getParent();
} }
return null; return null;

View File

@ -0,0 +1,445 @@
/******************************************************************************
* Copyright (C) 2016 Logilite Technologies LLP *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.webui.apps.form;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.AbstractADWindowContent;
import org.adempiere.webui.adwindow.QuickGridView;
import org.adempiere.webui.component.Borderlayout;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.CustomizeGridViewDialog;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.DataStatusEvent;
import org.compiere.model.DataStatusListener;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.MRole;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Trx;
import org.zkforge.keylistener.Keylistener;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Column;
import org.zkoss.zul.Columns;
/**
* Quick entry form
*
* @author Logilite Technologies
* @since Nov 03, 2017
*/
public class WQuickForm extends Window implements EventListener <Event>, DataStatusListener
{
/**
*
*/
private static final long serialVersionUID = -5095168843989540551L;
public Trx trx = null;
private Borderlayout mainLayout = new Borderlayout();
private AbstractADWindowContent adWinContent = null;
private QuickGridView quickGridView = null;
private GridTab gridTab;
private ConfirmPanel confirmPanel = new ConfirmPanel(true, true, false, false, false, false);
private Button bDelete = confirmPanel.createButton(ConfirmPanel.A_DELETE);
private Button bSave = confirmPanel.createButton("Save");
private Button bIgnore = confirmPanel.createButton("Ignore");
private Button bCustomize = confirmPanel.createButton("Customize");
private Button bUnSort = confirmPanel.createButton("UnSort");
private boolean onlyCurrentRows = false;
private int onlyCurrentDays = 0;
QuickGridView prevQGV = null;
private int windowNo;
public WQuickForm(AbstractADWindowContent winContent, boolean m_onlyCurrentRows, int m_onlyCurrentDays)
{
super();
this.setMode(Mode.POPUP);
windowNo = SessionManager.getAppDesktop().registerWindow(this);
adWinContent = winContent;
onlyCurrentRows = m_onlyCurrentRows;
onlyCurrentDays = m_onlyCurrentDays;
this.gridTab = adWinContent.getADTab().getSelectedGridTab();
this.quickGridView = new QuickGridView(adWinContent, gridTab, this);
this.quickGridView.setVisible(true);
initForm();
gridTab.isQuickForm = true;
gridTab.addDataStatusListener(this);
// To maintain parent-child Quick Form
prevQGV = adWinContent.getCurrQGV();
adWinContent.setCurrQGV(quickGridView);
}
protected void initForm( )
{
initZk();
createNewRow();
quickGridView.refresh(gridTab);
}
private void initZk( )
{
// Center
Panel Center = new Panel();
Center.appendChild(quickGridView);
ZkCssHelper.appendStyle(Center, "border: none; width: 100%; height:99%; background: gainsboro;");
// South
Panel south = new Panel();
// Adding statusBar for Quick Form
south.appendChild(adWinContent.getStatusBarQF());
ZkCssHelper.appendStyle(adWinContent.getStatusBarQF(), "height: 20px; padding-bottom: 3px background: white");
south.appendChild(confirmPanel);
ZkCssHelper.appendStyle(confirmPanel, "height: 50px; padding-top: 9px; background: #9c9c9c;");
bSave.setEnabled(!gridTab.isReadOnly());
bDelete.setEnabled(!gridTab.isReadOnly());
bIgnore.setEnabled(!gridTab.isReadOnly());
bUnSort.setEnabled(!gridTab.isReadOnly());
bSave.addEventListener(Events.ON_CLICK, this);
bDelete.addEventListener(Events.ON_CLICK, this);
bIgnore.addEventListener(Events.ON_CLICK, this);
bCustomize.addEventListener(Events.ON_CLICK, this);
bUnSort.addEventListener(Events.ON_CLICK, this);
// Add Shortcut Key info in tool-tip
bSave.setTooltiptext(bSave.getTooltiptext() + " (Alt+S) Save current record if modified");
bIgnore.setTooltiptext(bIgnore.getTooltiptext() + " (Alt+Z) Ignore un-save changes of current record");
bDelete.setTooltiptext(bDelete.getTooltiptext() + " (Alt+D) Delete selected or current record");
bCustomize.setTooltiptext(bCustomize.getTooltiptext() + " (Alt+L) Customize panel as per user");
Button bRefresh = confirmPanel.getButton(ConfirmPanel.A_REFRESH);
bRefresh.setTooltiptext(bRefresh.getTooltiptext() + " (Alt+E) ReQuery all record");
Button bCancle = confirmPanel.getButton(ConfirmPanel.A_CANCEL);
bCancle.setTooltiptext(bCancle.getTooltiptext() + " (Alt+X) Close quick form");
Button bok = confirmPanel.getButton(ConfirmPanel.A_OK);
bok.setTooltiptext(bok.getTooltiptext() + " (Alt+K) Save and Close quick form");
Button bunSort = confirmPanel.getButton("UnSort");
bunSort.setTooltiptext(bunSort.getTooltiptext() + " (Alt + R) Restore sorting to natural if column sorted");
confirmPanel.addComponentsLeft(bSave);
confirmPanel.addComponentsLeft(bDelete);
confirmPanel.addComponentsLeft(bIgnore);
confirmPanel.addComponentsLeft(bCustomize);
confirmPanel.addComponentsLeft(bUnSort);
confirmPanel.addActionListener(this);
mainLayout.appendCenter(Center);
mainLayout.appendSouth(south);
this.appendChild(mainLayout);
} // initZk
@Override
public void onEvent(Event event) throws Exception
{
if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_CANCEL))
{
onCancel();
}
else if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_REFRESH))
{
quickGridView.getRenderer().setCurrentCell(null);
onRefresh();
}
if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_OK))
{
onSave();
dispose();
}
else if (event.getTarget() == confirmPanel.getButton("Save"))
{
quickGridView.getRenderer().setCurrentCell(null);
onSave();
}
else if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_DELETE))
{
quickGridView.getRenderer().setCurrentCell(null);
onDelete();
}
else if (event.getTarget() == confirmPanel.getButton("Ignore"))
{
quickGridView.getRenderer().setCurrentCell(null);
onIgnore();
}
else if (event.getTarget() == confirmPanel.getButton("Customize"))
{
onCustomize();
}
else if (event.getTarget() == confirmPanel.getButton("UnSort"))
{
onUnSort();
}
event.stopPropagation();
} // onEvent
public void onCancel( )
{
if (gridTab.getTableModel().getRowChanged() > -1)
{
FDialog.ask(windowNo, this, "SaveChanges?", new Callback <Boolean>() {
@Override
public void onCallback(Boolean result)
{
if (result)
onSave();
dispose();
}
});
}
else
{
dispose();
}
} // onCancel
public void onUnSort( )
{
adWinContent.getActiveGridTab().getTableModel().resetCacheSortState();
Column sortColumn = quickGridView.findCurrentSortColumn();
onRefresh();
if (sortColumn != null)
sortColumn.setSortDirection("natural");
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "UnSort"), false);
} // onUnSort
public void onCustomize( )
{
onSave();
//
Columns columns = quickGridView.getListbox().getColumns();
List <Component> columnList = columns.getChildren();
GridField[] fields = quickGridView.getGridField();
Map <Integer, String> columnsWidth = new HashMap <Integer, String>();
ArrayList <Integer> gridFieldIds = new ArrayList <Integer>();
for (int i = 0; i < fields.length; i++)
{
Column column = (Column) columnList.get(i + 1);
String width = column.getWidth();
columnsWidth.put(fields[i].getAD_Field_ID(), width);
gridFieldIds.add(fields[i].getAD_Field_ID());
}
ZKUpdateUtil.setWidth(quickGridView, getWidth());
ZKUpdateUtil.setHeight(quickGridView, getHeight());
CustomizeGridViewDialog.showCustomize(0, gridTab.getAD_Tab_ID(), columnsWidth, gridFieldIds, null, quickGridView, true);
} // onCustomize
public void onIgnore( )
{
gridTab.dataIgnore();
gridTab.dataRefreshAll();
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "Ignored"), false);
quickGridView.isNewLineSaved = true;
// Create new record if no record present.
if (gridTab.getRowCount() <= 0)
createNewRow();
quickGridView.updateListIndex();
Events.echoEvent(QuickGridView.EVENT_ON_SET_FOCUS_TO_FIRST_CELL, quickGridView, null);
} // onIgnore
public void onDelete( )
{
if (gridTab == null || !quickGridView.isNewLineSaved)
return;
// if no any row selected then delete current record
if (gridTab.getSelection().length == 0)
gridTab.addToSelection(quickGridView.getRenderer().getCurrentRowIndex());
final int[] indices = gridTab.getSelection();
if (indices.length > 0)
{
FDialog.ask(windowNo, this, "DeleteRecord?", new Callback <Boolean>() {
@Override
public void onCallback(Boolean result)
{
if (result)
{
boolean isAllSelected = quickGridView.isAllSelected();
quickGridView.isNewLineSaved = true;
gridTab.clearSelection();
quickGridView.toggleSelectionForAll(false);
Arrays.sort(indices);
int count = 0;
for (int i = 0, offset = 0; i < indices.length; i++)
{
gridTab.navigate(indices[i] - offset);
if (gridTab.dataDelete())
{
offset++;
count++;
}
else
{
break;
}
}
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "Deleted") + ": " + count + " / " + indices.length, false);
// if all records is deleted then it will show default with new record.
if (gridTab.getRowCount() <= 0)
quickGridView.createNewLine();
quickGridView.updateListIndex();
// Set focus on the first row if all Row's are selected.
if (isAllSelected)
Events.echoEvent(QuickGridView.EVENT_ON_PAGE_NAVIGATE, quickGridView, null);
else
Events.echoEvent(QuickGridView.EVENT_ON_SET_FOCUS_TO_FIRST_CELL, quickGridView, null);
}
else
{
gridTab.clearSelection();
quickGridView.toggleSelectionForAll(false);
}
}
});
}
} // onDelete
public void onSave( )
{
if (gridTab.getTableModel().getRowChanged() == gridTab.getCurrentRow())
{
if (quickGridView.dataSave(0))
{
gridTab.dataRefreshAll();
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "Saved"), false);
Events.echoEvent(QuickGridView.EVENT_ON_SET_FOCUS_TO_FIRST_CELL, quickGridView, null);
}
}
else
{
onIgnore();
}
} // onSave
public void onRefresh( )
{
gridTab.dataRefreshAll();
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "Refresh"), false);
quickGridView.isNewLineSaved = true;
quickGridView.updateListIndex();
Events.echoEvent(QuickGridView.EVENT_ON_SET_FOCUS_TO_FIRST_CELL, quickGridView, null);
// Create new record if no record present.
if (gridTab.getRowCount() <= 0)
createNewRow();
} // onRefresh
@Override
public void dispose( )
{
super.dispose();
gridTab.setQuickForm(false);
onIgnore();
gridTab.removeDataStatusListener(this);
SessionManager.closeQuickFormTab(gridTab.getAD_Tab_ID());
quickGridView.getRenderer().clearMaps();
int tabLevel = adWinContent.getToolbar().getQuickFormTabHrchyLevel();
if (tabLevel > 0)
{
adWinContent.getToolbar().setQuickFormTabHrchyLevel(tabLevel - 1);
Keylistener keyListener = SessionManager.getSessionApplication().getKeylistener();
keyListener.setCtrlKeys(keyListener.getCtrlKeys() + QuickGridView.CNTRL_KEYS);
// Add Key-listener of parent Quick Form
if (prevQGV != null)
{
adWinContent.onParentRecord();
SessionManager.getSessionApplication().getKeylistener().addEventListener(Events.ON_CTRL_KEY, prevQGV);
// TODO need to set focus on last focused row of parent Form.
Events.echoEvent(QuickGridView.EVENT_ON_PAGE_NAVIGATE, prevQGV, null);
}
adWinContent.setCurrQGV(prevQGV);
}
else
{
adWinContent.setCurrQGV(null);
}
adWinContent.getADTab().getSelectedTabpanel().query(onlyCurrentRows, onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize
} // dispose
private void createNewRow( )
{
int row = gridTab.getRowCount();
// creating the first record from the parent tab first record is duplicated on KEY DOWN.
// If a grid does not have a record or blank record then create a new row.
if (row <= 0 || (gridTab.isNew() && row == 1))
{
gridTab.dataIgnore();
if (gridTab.isInsertRecord())
{
quickGridView.createNewLine();
}
else
{
adWinContent.getStatusBarQF().setStatusLine(Msg.getMsg(Env.getCtx(), "NewError"), true);
}
}
} // createNewRow
@Override
public void dataStatusChanged(DataStatusEvent e)
{
// ignore background event
if (Executions.getCurrent() == null || e.isInitEdit())
return;
// update Dynamic display on data Status change.
int col = e.getChangedColumn();
quickGridView.dynamicDisplay(col);
} // dataStatusChanged
}

View File

@ -29,6 +29,7 @@ import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.ValuePreference; import org.adempiere.webui.ValuePreference;
import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.adwindow.ADWindowContent; import org.adempiere.webui.adwindow.ADWindowContent;
import org.adempiere.webui.adwindow.QuickGridTabRowRenderer;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Searchbox; import org.adempiere.webui.component.Searchbox;
import org.adempiere.webui.event.ContextMenuEvent; import org.adempiere.webui.event.ContextMenuEvent;
@ -73,6 +74,7 @@ import org.zkoss.zk.ui.util.Clients;
public class WSearchEditor extends WEditor implements ContextMenuListener, ValueChangeListener, IZoomableEditor public class WSearchEditor extends WEditor implements ContextMenuListener, ValueChangeListener, IZoomableEditor
{ {
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK};
public static final String ATTRIBUTE_IS_INFO_PANEL_OPEN = "ATTRIBUTE_IS_INFO_PANEL_OPEN";
private Lookup lookup; private Lookup lookup;
private String m_tableName = null; private String m_tableName = null;
private String m_keyColumnName = null; private String m_keyColumnName = null;
@ -97,6 +99,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
columnName = lookup.getColumnName(); columnName = lookup.getColumnName();
init(); init();
getComponent().setAttribute(ATTRIBUTE_IS_INFO_PANEL_OPEN, false);
} }
@ -253,7 +256,13 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
actionText(getComponent().getText()); actionText(getComponent().getText());
} }
else if ((Events.ON_OK.equals(e.getName()))) { else if ((Events.ON_OK.equals(e.getName()))) {
if (getComponent().getText() == null || getComponent().getText().length() == 0) { // Do not allow to open info panel if component text is empty & belongs to quick form.
boolean isQuickFormComp = false;
if (getComponent().getAttribute(QuickGridTabRowRenderer.IS_QUICK_FORM_COMPONENT) != null)
isQuickFormComp = (boolean) getComponent().getAttribute(QuickGridTabRowRenderer.IS_QUICK_FORM_COMPONENT);
if ((getComponent().getText() == null || getComponent().getText().length() == 0) && !isQuickFormComp)
{
// open Info window similar to swing client // open Info window similar to swing client
if (infoPanel != null) if (infoPanel != null)
{ {
@ -567,6 +576,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
ip.setClosable(true); ip.setClosable(true);
ip.addValueChangeListener(this); ip.addValueChangeListener(this);
infoPanel = ip; infoPanel = ip;
getComponent().setAttribute(ATTRIBUTE_IS_INFO_PANEL_OPEN, true);
ip.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { ip.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override
@ -610,6 +620,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
{ {
if (log.isLoggable(Level.CONFIG)) log.config(getColumnName() + " - Result = null (not cancelled)"); if (log.isLoggable(Level.CONFIG)) log.config(getColumnName() + " - Result = null (not cancelled)");
getComponent().getTextbox().focus(); getComponent().getTextbox().focus();
getComponent().setAttribute(ATTRIBUTE_IS_INFO_PANEL_OPEN, false);
} }
} }
}); });

View File

@ -51,7 +51,6 @@ import org.compiere.model.MTab;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.X_AD_Tab_Customization; import org.compiere.model.X_AD_Tab_Customization;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.NamePair; import org.compiere.util.NamePair;
@ -556,34 +555,9 @@ public class CustomizeGridViewPanel extends Panel
String gridview = null; String gridview = null;
if (lstGridMode.getSelectedItem() != null && lstGridMode.getSelectedItem().toString().length() > 0) if (lstGridMode.getSelectedItem() != null && lstGridMode.getSelectedItem().toString().length() > 0)
gridview = lstGridMode.getSelectedItem().toString(); gridview = lstGridMode.getSelectedItem().toString();
if (m_tabcust != null && m_tabcust.getAD_Tab_Customization_ID() > 0) { final String dView = gridview;
m_tabcust.setCustom(custom.toString());
m_tabcust.setIsDisplayedGrid(gridview); ok = MTabCustomization.saveData(Env.getCtx(), m_AD_Tab_ID, m_AD_User_ID, custom.toString(), dView, null, false);
} else {
m_tabcust = new MTabCustomization(Env.getCtx(), 0, null);
m_tabcust.setAD_Tab_ID(m_AD_Tab_ID);
m_tabcust.set_ValueOfColumn("AD_User_ID", m_AD_User_ID);
m_tabcust.setCustom(custom.toString());
m_tabcust.setIsDisplayedGrid(gridview);
}
if (m_tabcust.getCustom() == null || m_tabcust.getCustom().trim().length() == 0)
{
if (m_tabcust.is_new())
{
//no action needed
getParent().detach();
return;
}
else
{
ok = m_tabcust.delete(true);
}
}
else
{
ok = m_tabcust.save();
}
//
if(ok) { if(ok) {
m_saved = true; m_saved = true;
// FDialog.info(m_WindowNo, null, "Saved"); // FDialog.info(m_WindowNo, null, "Saved");

View File

@ -0,0 +1,555 @@
/******************************************************************************
* Copyright (C) 2016 Logilite Technologies LLP *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.webui.panel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import org.adempiere.exceptions.DBException;
import org.adempiere.model.MTabCustomization;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.adwindow.QuickGridView;
import org.adempiere.webui.component.Borderlayout;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListHeader;
import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.factory.ButtonFactory;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.I_AD_Field;
import org.compiere.model.MField;
import org.compiere.model.MRole;
import org.compiere.model.MTab;
import org.compiere.model.Query;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.NamePair;
import org.zkoss.zhtml.Span;
import org.zkoss.zk.au.out.AuFocus;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.North;
import org.zkoss.zul.Separator;
import org.zkoss.zul.South;
import org.zkoss.zul.Vbox;
/**
* Customize grid panel for quick form
*
* @author Logilite Technologies
* @since Nov 08, 2017
*/
public class QuickCustomizeGridViewPanel extends Panel {
/**
*
*/
private static final long serialVersionUID = 721233085611663253L;
static CLogger log = CLogger.getCLogger(QuickCustomizeGridViewPanel.class);
private Map <Integer, String> m_columnsWidth;
ArrayList <Integer> tableSeqs;
QuickGridView gridview = null;
private int m_WindowNo;
private int m_AD_Tab_ID;
private int m_AD_User_ID;
// UI variables
private Label yesLabel = new Label();
private Button bDown = ButtonFactory.createNamedButton("MoveDown");
private Button bUp = ButtonFactory.createNamedButton("MoveUp");
private Checkbox chkSaveWidth = new Checkbox();
SimpleListModel yesModel = new SimpleListModel();
Listbox yesList = new Listbox();
private boolean uiCreated;
private boolean m_saved = false;
private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, true, false, false, false);
/**
* Sort Tab Constructor
*
* @param WindowNo
* Window No
* @param columnsWidth
* @param GridTab
*/
public QuickCustomizeGridViewPanel(int WindowNo, int AD_Tab_ID, int AD_User_ID, Map <Integer, String> columnsWidth, ArrayList <Integer> gridFieldIds)
{
m_WindowNo = WindowNo;
m_AD_Tab_ID = AD_Tab_ID;
m_AD_User_ID = AD_User_ID;
m_columnsWidth = columnsWidth;
tableSeqs = gridFieldIds;
this.setStyle("position: relative; height: 100%; width: 100%; margin: none; border: none; padding: none;");
}
/**
* Static Layout
*
* @throws Exception
*/
private void init() throws Exception {
Borderlayout layout = new Borderlayout();
layout.setStyle("height: 100%; width: 100%; border: none; margin: none; padding: 2px;");
yesLabel.setValue(Msg.getMsg(Env.getCtx(), "Selected"));
ZKUpdateUtil.setVflex(yesList, true);
ZKUpdateUtil.setHeight(yesList, "300px");
yesList.setSeltype("multiple");
EventListener<Event> crossListMouseListener = new DragListener();
yesList.addOnDropListener(crossListMouseListener);
yesList.setItemDraggable(true);
EventListener<Event> actionListener = new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
migrateValueWithinYesList(event);
}
};
bUp.addEventListener(Events.ON_CLICK, actionListener);
bDown.addEventListener(Events.ON_CLICK, actionListener);
Panel northPanel = new Panel();
ListHead listHead = new ListHead();
listHead.setParent(yesList);
ListHeader listHeader = new ListHeader();
listHeader.appendChild(yesLabel);
listHeader.setParent(listHead);
Span span = new Span();
span.setParent(northPanel);
span.setStyle("height: 99%; display: inline-block; width: 86%; float: left;");
span.appendChild(yesList);
Vbox vbox = new Vbox();
vbox.appendChild(bUp);
vbox.appendChild(bDown);
span = new Span();
span.setParent(northPanel);
span.setStyle("height: 99%; display: inline-block; width: 60px; float: left;");
span.appendChild(vbox);
North north = new North();
north.setStyle("border: none; margin: 0; padding: 0; ");
north.appendChild(northPanel);
layout.appendChild(north);
South south = new South();
south.setStyle("border: none; margin: 0; padding: 0; ");
Separator sep = new Separator();
sep.setSpacing("2px");
Panel southPanel = new Panel();
southPanel.appendChild(sep);
chkSaveWidth.setLabel(Msg.getMsg(Env.getCtx(), "SaveColumnWidth"));
vbox = new Vbox();
Hbox hbox = new Hbox();
hbox.appendChild(chkSaveWidth);
vbox.appendChild(hbox);
vbox.appendChild(sep);
hbox = new Hbox();
vbox.appendChild(hbox);
southPanel.appendChild(vbox);
southPanel.appendChild(sep);
LayoutUtils.addSclass("dialog-footer", confirmPanel);
EventListener<Event> onClickListener = new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_OK))) {
saveData();
} else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_CANCEL))) {
if (gridview != null) {
Events.postEvent("onCustomizeGrid", gridview, null);
}
getParent().detach();
} else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_RESET))) {
MTabCustomization tabCust = MTabCustomization.get(Env.getCtx(), m_AD_User_ID, m_AD_Tab_ID, null,true);
if (tabCust != null && tabCust.getAD_Tab_Customization_ID() > 0)
tabCust.deleteEx(true);
}
}
};
confirmPanel.addActionListener(onClickListener);
southPanel.appendChild(confirmPanel);
south.appendChild(southPanel);
layout.appendChild(south);
this.appendChild(layout);
} // init
public void loadData() {
MTabCustomization tabCust = MTabCustomization.get(Env.getCtx(), m_AD_User_ID, m_AD_Tab_ID, null,true);
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Field");
yesModel.removeAllElements();
Query query = null;
query = new Query(Env.getCtx(), I_AD_Field.Table_Name,
"AD_Tab_ID=? AND (IsDisplayed='Y' OR IsDisplayedGrid='Y') AND IsActive='Y' AND IsQuickForm='Y'", null);
query.setOrderBy("SeqNoGrid, Name, SeqNo");
query.setParameters(new Object[] { m_AD_Tab_ID });
query.setApplyAccessFilter(true);
try {
List<MField> lsFieldsOfGrid = query.list();
HashMap<Integer, ListElement> curTabSel = new HashMap<Integer, QuickCustomizeGridViewPanel.ListElement>();
MTab tab = new MTab(Env.getCtx(), m_AD_Tab_ID, null);
for (MField field : lsFieldsOfGrid) {
if (!MRole.getDefault(Env.getCtx(), false).isColumnAccess(tab.getAD_Table_ID(), field.getAD_Column_ID(),
true))
continue;
int key = field.get_ID();
String name = null;
if (baseLanguage)
name = field.getName();
else
name = field.get_Translation(I_AD_Field.COLUMNNAME_Name);
ListElement pp = new ListElement(key, name);
if (tableSeqs != null && tableSeqs.size() > 0) {
if (tableSeqs.contains(key)) {
curTabSel.put(key, pp);
}
}
}
if (tableSeqs != null) {
for (int key : tableSeqs) {
if (curTabSel.get(key) != null) {
yesModel.addElement(curTabSel.get(key));
}
}
}
} catch (DBException e) {
log.log(Level.SEVERE, e.getMessage(), e);
}
bUp.setEnabled(true);
bDown.setEnabled(true);
yesList.setEnabled(true);
yesList.setItemRenderer(yesModel);
yesList.setModel(yesModel);
if ((tabCust != null && tabCust.getCustom().indexOf("px") > 0))
chkSaveWidth.setChecked(true);
} // loadData
void migrateLists(Listbox listFrom, Listbox listTo, int endIndex) {
int index = 0;
SimpleListModel lmFrom = (SimpleListModel) listFrom.getModel();
SimpleListModel lmTo = (SimpleListModel) listTo.getModel();
Set<?> selectedItems = listFrom.getSelectedItems();
List<ListElement> selObjects = new ArrayList<ListElement>();
for (Object obj : selectedItems) {
ListItem listItem = (ListItem) obj;
index = listFrom.getIndexOfItem(listItem);
ListElement selObject = (ListElement) lmFrom.getElementAt(index);
selObjects.add(selObject);
}
for (ListElement selObject : selObjects) {
if (selObject == null || !selObject.isUpdateable())
continue;
lmFrom.removeElement(selObject);
lmTo.add(endIndex, selObject);
endIndex++;
index = lmTo.indexOf(selObject);
listTo.setSelectedIndex(index);
}
}
/**
* Move within Yes List with Drag Event and Multiple Choice
*
* @param event event
*/
void migrateValueWithinYesList(int endIndex, List<ListElement> selObjects) {
int iniIndex = 0;
Arrays.sort(selObjects.toArray());
ListElement endObject = (ListElement) yesModel.getElementAt(endIndex);
for (ListElement selected : selObjects) {
iniIndex = yesModel.indexOf(selected);
ListElement selObject = (ListElement) yesModel.getElementAt(iniIndex);
yesModel.removeElement(selObject);
endIndex = yesModel.indexOf(endObject);
yesModel.add(endIndex, selObject);
}
}
/**
* Move within Yes List
*
* @param event event
*/
void migrateValueWithinYesList(Event event) {
Object[] selObjects = yesList.getSelectedItems().toArray();
if (selObjects == null)
return;
int length = selObjects.length;
if (length == 0)
return;
//
int[] indices = yesList.getSelectedIndices();
Arrays.sort(indices);
//
boolean change = false;
//
Object source = event.getTarget();
if (source == bUp) {
for (int i = 0; i < length; i++) {
int index = indices[i];
if (index == 0)
break;
ListElement selObject = (ListElement) yesModel.getElementAt(index);
ListElement newObject = (ListElement) yesModel.getElementAt(index - 1);
if (!selObject.isUpdateable() || !newObject.isUpdateable())
break;
yesModel.setElementAt(newObject, index);
yesModel.setElementAt(selObject, index - 1);
indices[i] = index - 1;
change = true;
}
} // up
else if (source == bDown) {
for (int i = length - 1; i >= 0; i--) {
int index = indices[i];
if (index >= yesModel.getSize() - 1)
break;
ListElement selObject = (ListElement) yesModel.getElementAt(index);
ListElement newObject = (ListElement) yesModel.getElementAt(index + 1);
if (!selObject.isUpdateable() || !newObject.isUpdateable())
break;
yesModel.setElementAt(newObject, index);
yesModel.setElementAt(selObject, index + 1);
yesList.setSelectedIndex(index + 1);
indices[i] = index + 1;
change = true;
}
} // down
//
if (change) {
yesList.setSelectedIndices(indices);
if (yesList.getSelectedItem() != null) {
AuFocus focus = new AuFocus(yesList.getSelectedItem());
Clients.response(focus);
}
}
} // migrateValueWithinYesList
public void saveData() {
// yesList
// int index = 0;
boolean ok = true;
final StringBuilder custom = new StringBuilder();
for (int i = 0; i < yesModel.getSize(); i++) {
ListElement pp = (ListElement) yesModel.getElementAt(i);
if (!pp.isUpdateable())
continue;
if (i > 0)
custom.append(",");
custom.append(pp.getKey());
}
if (chkSaveWidth.isSelected() && m_columnsWidth != null && !m_columnsWidth.isEmpty()) {
for (int i = 0; i < yesModel.getSize(); i++) {
if (i > 0)
custom.append(",");
else
custom.append(";");
ListElement pp = (ListElement) yesModel.getElementAt(i);
int fieldId = pp.getKey();
String width = m_columnsWidth.get(fieldId);
if (width == null)
width = "";
custom.append(width);
}
}
// save Window width and height
ok = MTabCustomization.saveData(Env.getCtx(), m_AD_Tab_ID, m_AD_User_ID, custom.toString(), null, null,true);
if (ok) {
m_saved = true;
gridview.setStatusLine("Customize Preference Saved.", false);
if (gridview != null) {
Events.postEvent("onCustomizeGrid", gridview, null);
}
getParent().detach();
} else {
FDialog.error(m_WindowNo, null, "SaveError", custom.toString());
}
} // saveData
public void activate(boolean b) {
if (b && !uiCreated)
createUI();
}
public void createUI() {
if (uiCreated)
return;
try {
init();
} catch (Exception e) {
log.log(Level.SEVERE, "", e);
}
uiCreated = true;
}
public boolean isSaved() {
return m_saved;
}
public void setGridPanel(QuickGridView quickGridView) {
this.gridview = quickGridView;
}
/**
* ListElement Item
*/
private static class ListElement extends NamePair {
/**
*
*/
private static final long serialVersionUID = 884539656654102968L;
private int m_key;
private boolean m_updateable;
public ListElement(int key, String name) {
super(name);
this.m_key = key;
this.m_updateable = true;
}
public int getKey() {
return m_key;
}
public boolean isUpdateable() {
return m_updateable;
}
@Override
public String getID() {
return m_key != -1 ? String.valueOf(m_key) : null;
}
@Override
public int hashCode() {
return m_key;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ListElement) {
ListElement li = (ListElement) obj;
return li.getKey() == m_key && li.getName() != null && li.getName().equals(getName());
}
return false;
} // equals
@Override
public String toString() {
String s = super.toString();
if (s == null || s.trim().length() == 0)
s = "<" + getKey() + ">";
return s;
}
} // ListElement Class
/**
* DragListener Class
*/
private class DragListener implements EventListener<Event> {
/**
* Creates a ADSortTab.DragListener.
*/
public DragListener() {
}
@Override
public void onEvent(Event event) throws Exception {
if (event instanceof DropEvent) {
int endIndex = 0;
DropEvent me = (DropEvent) event;
ListItem endItem = (ListItem) me.getTarget();
ListItem startItem = (ListItem) me.getDragged();
if (!startItem.isSelected())
startItem.setSelected(true);
if (!(startItem.getListbox() == endItem.getListbox())) {
Listbox listFrom = (Listbox) startItem.getListbox();
Listbox listTo = (Listbox) endItem.getListbox();
endIndex = yesList.getIndexOfItem(endItem);
migrateLists(listFrom, listTo, endIndex);
} else if (startItem.getListbox() == endItem.getListbox() && startItem.getListbox() == yesList) {
List<ListElement> selObjects = new ArrayList<ListElement>();
endIndex = yesList.getIndexOfItem(endItem);
for (Object obj : yesList.getSelectedItems()) {
ListItem listItem = (ListItem) obj;
int index = yesList.getIndexOfItem(listItem);
ListElement selObject = (ListElement) yesModel.getElementAt(index);
selObjects.add(selObject);
}
migrateValueWithinYesList(endIndex, selObjects);
yesList.clearSelection();
}
}
}
} // DragListener Class
} // QuickCustomizeGridPanel Class

View File

@ -18,6 +18,7 @@
package org.adempiere.webui.session; package org.adempiere.webui.session;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.LinkedList;
import java.util.Properties; import java.util.Properties;
import org.adempiere.webui.IWebClient; import org.adempiere.webui.IWebClient;
@ -26,6 +27,8 @@ import org.adempiere.webui.desktop.IDesktop;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Session;
/** /**
* *
@ -36,6 +39,8 @@ import org.zkoss.zk.ui.Desktop;
public class SessionManager public class SessionManager
{ {
public static final String SESSION_APPLICATION = "SessionApplication"; public static final String SESSION_APPLICATION = "SessionApplication";
// Keep track of open Quick Form
public static final String SESSION_QUICKFORM = "SessionQuickForm";
public static boolean isUserLoggedIn(Properties ctx) public static boolean isUserLoggedIn(Properties ctx)
{ {
@ -94,4 +99,42 @@ public class SessionManager
app.changeRole(user); app.changeRole(user);
} }
public static boolean registerQuickFormTab(Integer AD_Tab_ID)
{
LinkedList<Integer> openTabs = getOpenQuickFormTabs();
if (openTabs.contains(AD_Tab_ID))
{
return false;
}
openTabs.add(AD_Tab_ID);
getSession().setAttribute(SESSION_QUICKFORM, openTabs);
return true;
}
@SuppressWarnings("unchecked")
public static LinkedList<Integer> getOpenQuickFormTabs()
{
LinkedList<Integer> tabs = (LinkedList<Integer>) getSession().getAttribute(SESSION_QUICKFORM);
if (tabs == null)
{
tabs = new LinkedList<Integer>();
}
return tabs;
}
public static void closeQuickFormTab(Integer AD_Tab_ID)
{
LinkedList<Integer> openTabs = getOpenQuickFormTabs();
openTabs.remove(AD_Tab_ID);
getSession().setAttribute(SESSION_QUICKFORM, openTabs);
}
private static Session getSession()
{
return Executions.getCurrent().getDesktop().getSession();
}
} }

View File

@ -4,11 +4,13 @@ import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import org.adempiere.webui.adwindow.GridView; import org.adempiere.webui.adwindow.GridView;
import org.adempiere.webui.adwindow.QuickGridView;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.CustomizeGridViewPanel; import org.adempiere.webui.panel.CustomizeGridViewPanel;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.panel.QuickCustomizeGridViewPanel;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -20,6 +22,8 @@ public class CustomizeGridViewDialog extends Window {
private static final long serialVersionUID = -4093048147438176240L; private static final long serialVersionUID = -4093048147438176240L;
private CustomizeGridViewPanel customizePanel; private CustomizeGridViewPanel customizePanel;
private QuickCustomizeGridViewPanel quickCustomizePanel;
private boolean isQuickForm = false;
/** /**
* Standard Constructor * Standard Constructor
@ -27,16 +31,26 @@ public class CustomizeGridViewDialog extends Window {
* @param AD_Tab_ID tab * @param AD_Tab_ID tab
* @param AD_User_ID user * @param AD_User_ID user
* @param columnsWidth * @param columnsWidth
* @param isQuickForm
*/ */
public CustomizeGridViewDialog(int windowNo, int AD_Tab_ID, int AD_User_ID, Map<Integer, String> columnsWidth,ArrayList<Integer> gridFieldIds) public CustomizeGridViewDialog(int windowNo, int AD_Tab_ID, int AD_User_ID, Map<Integer, String> columnsWidth,
{ ArrayList<Integer> gridFieldIds, boolean isQuickForm) {
setClosable(true); setClosable(true);
setTitle(Msg.getMsg(Env.getCtx(), "Customize")); setTitle(Msg.getMsg(Env.getCtx(), "Customize"));
initComponent(windowNo,AD_Tab_ID, AD_User_ID, columnsWidth,gridFieldIds); this.isQuickForm = isQuickForm;
initComponent(windowNo, AD_Tab_ID, AD_User_ID, columnsWidth, gridFieldIds);
} }
private void initComponent(int windowNo, int AD_Tab_ID, int AD_User_ID, Map<Integer, String> columnsWidth,ArrayList<Integer> gridFieldIds) { private void initComponent(int windowNo, int AD_Tab_ID, int AD_User_ID, Map<Integer, String> columnsWidth, ArrayList<Integer> gridFieldIds) {
customizePanel = new CustomizeGridViewPanel(windowNo, AD_Tab_ID, AD_User_ID, columnsWidth,gridFieldIds); if (isQuickForm)
{
quickCustomizePanel = new QuickCustomizeGridViewPanel(windowNo, AD_Tab_ID, AD_User_ID, columnsWidth,
gridFieldIds);
}
else
{
customizePanel = new CustomizeGridViewPanel(windowNo, AD_Tab_ID, AD_User_ID, columnsWidth, gridFieldIds);
}
this.setStyle("position : relative;"); this.setStyle("position : relative;");
if (!ThemeManager.isUseCSSForWindowSize()) { if (!ThemeManager.isUseCSSForWindowSize()) {
ZKUpdateUtil.setWindowWidthX(this, 600); ZKUpdateUtil.setWindowWidthX(this, 600);
@ -49,16 +63,34 @@ public class CustomizeGridViewDialog extends Window {
} }
this.setBorder("normal"); this.setBorder("normal");
this.setSclass("popup-dialog customize-grid-view-dialog"); this.setSclass("popup-dialog customize-grid-view-dialog");
appendChild(customizePanel);
customizePanel.createUI(); if (isQuickForm)
customizePanel.query(); {
ZKUpdateUtil.setWidth(this, "500px");
ZKUpdateUtil.setHeight(this, "410px");
quickCustomizePanel.createUI();
quickCustomizePanel.loadData();
appendChild(quickCustomizePanel);
}
else
{
ZKUpdateUtil.setWidth(this, "600px");
ZKUpdateUtil.setHeight(this, "500px");
appendChild(customizePanel);
customizePanel.createUI();
customizePanel.query();
}
} }
/** /**
* @return whether change have been successfully save to db * @return whether change have been successfully save to db
*/ */
public boolean isSaved() { public boolean isSaved() {
return customizePanel.isSaved(); if (isQuickForm)
return quickCustomizePanel.isSaved();
else
return customizePanel.isSaved();
} }
public void setGridPanel(GridView gridPanel){ public void setGridPanel(GridView gridPanel){
@ -72,12 +104,32 @@ public class CustomizeGridViewDialog extends Window {
* @param columnsWidth * @param columnsWidth
* @param gridFieldIds list fieldId current display in gridview * @param gridFieldIds list fieldId current display in gridview
* @param gridPanel * @param gridPanel
* @param isQuickForm
* @param quickGridView
*/ */
public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map<Integer, String> columnsWidth,ArrayList<Integer> gridFieldIds,GridView gridPanel) public static boolean showCustomize(int WindowNo, int AD_Tab_ID, Map <Integer, String> columnsWidth, ArrayList <Integer> gridFieldIds, GridView gridPanel,
QuickGridView quickGridView, boolean isQuickForm)
{ {
CustomizeGridViewDialog customizeWindow = new CustomizeGridViewDialog(WindowNo, AD_Tab_ID, Env.getAD_User_ID(Env.getCtx()), columnsWidth,gridFieldIds); CustomizeGridViewDialog customizeWindow = new CustomizeGridViewDialog(WindowNo, AD_Tab_ID, Env.getAD_User_ID(Env.getCtx()), columnsWidth, gridFieldIds,
customizeWindow.setGridPanel(gridPanel); isQuickForm);
if (isQuickForm)
{
customizeWindow.setquickGridView(quickGridView);
}
else
{
customizeWindow.setGridPanel(gridPanel);
}
AEnv.showWindow(customizeWindow); AEnv.showWindow(customizeWindow);
return customizeWindow.isSaved(); return customizeWindow.isSaved();
} // showProduct } // showCustomize
/**
* @param QuickGridView
*/
private void setquickGridView(QuickGridView quickGridView)
{
quickCustomizePanel.setGridPanel(quickGridView);
}
} }

View File

@ -46,7 +46,7 @@ Copyright (C) 2007 Ashley G Ramdass.
id.zk.Extend = zk.$extends(zk.Object, {}, { id.zk.Extend = zk.$extends(zk.Object, {}, {
fakeOnchange: function (wgt) { fakeOnchange: function (wgt) {
// just sent fake event when control is textfield and value is not yet sync to server // just sent fake event when control is textfield and value is not yet sync to server
if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText()) if ((wgt.$instanceof(zul.inp.Textbox) || wgt.$instanceof(zul.inp.Decimalbox)) && wgt.$n().value != wgt.getText())
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value})); zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value}));
else if (zk.$import("ckez.CKeditor") != undefined && wgt.$instanceof(ckez.CKeditor)){//https://www.zkoss.org/javadoc/latest/jsdoc/_global_/zk.html#$import(_global_.String) else if (zk.$import("ckez.CKeditor") != undefined && wgt.$instanceof(ckez.CKeditor)){//https://www.zkoss.org/javadoc/latest/jsdoc/_global_/zk.html#$import(_global_.String)

View File

@ -286,3 +286,9 @@
.z-icon-Share:before { .z-icon-Share:before {
content: "\f0ac"; content: "\f0ac";
} }
.z-icon-QuickForm:before {
content: "\f0ae";
}
.z-icon-UnSort:before {
content: "\f074";
}

View File

@ -117,3 +117,19 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
.z-notification { .z-notification {
padding: 3px !important; padding: 3px !important;
} }
input[type="checkbox"]:focus
{
outline: #0000ff auto 1px;
-moz-outline-radius: 3px;
}
<%-- Quick Form Read-only Component --%>
.quickform-readonly .z-textbox-readonly, .quickform-readonly .z-intbox-readonly, .quickform-readonly .z-longbox-readonly, .quickform-readonly .z-doublebox-readonly,
.quickform-readonly .z-decimalbox-readonly, .quickform-readonly .z-datebox-readonly, .quickform-readonly .z-timebox-readonly, .quickform-readonly .editor-input-disd,
.quickform-readonly .z-textbox[readonly], .quickform-readonly .z-intbox[readonly], .quickform-readonly .z-longbox[readonly], .quickform-readonly .z-doublebox[readonly],
.quickform-readonly .z-decimalbox[readonly], .quickform-readonly .z-datebox[readonly], .quickform-readonly .z-timebox[readonly]
{
color: #252525 !important;
opacity: .8;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B