merge development (133921c9c84f) into zk7
This commit is contained in:
commit
cbddbb0e70
|
@ -0,0 +1,211 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Dec 2, 2014 4:51:26 PM COT
|
||||
-- IDEMPIERE-2103 Process for run import/export csv
|
||||
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,Name,AD_Org_ID,UpdatedBy,IsActive,CreatedBy,Classname,Value,AD_Client_ID,EntityType,Created,Updated) VALUES ('N',200076,'N','N','95ee94ea-d050-4f20-b4f3-1b6776df6d62','7','N','N',0,0,'Y','Import CSV Process',0,100,'Y',100,'org.idempiere.process.ImportCSVProcess','ImportCSVProcess',0,'D',TO_DATE('2014-12-02 16:51:25','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-12-02 16:51:25','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:52:29 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,AD_Process_ID,IsMandatory,Name,ColumnName,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,EntityType,Created) VALUES ('N',200111,'a75e1a11-f9e5-4d1f-9140-dde15f7c4c61',200076,'Y','Import Template','AD_ImportTemplate_ID',0,'Y',10,'Y',100,TO_DATE('2014-12-02 16:52:28','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,202793,19,'D',TO_DATE('2014-12-02 16:52:28','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:53:00 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,Help,AD_Process_ID,IsMandatory,Name,ColumnName,Description,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,EntityType,Created) VALUES ('N',200112,'11253af5-7dd2-441a-b1c1-2b1350e99e4e','Name of a file in the local directory space - or URL (file://.., http://.., ftp://..)',200076,'Y','File Name','FileName','Name of the local file or URL',0,'Y',20,'Y',100,TO_DATE('2014-12-02 16:52:59','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,2295,38,'D',TO_DATE('2014-12-02 16:52:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:07 PM COT
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType,Created) VALUES ('ImportMode',202807,'Import Mode','Import Mode','fef3fdab-e970-4c03-8789-1ae1c944ea5a',TO_DATE('2014-12-02 16:55:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y',0,'D',TO_DATE('2014-12-02 16:55:06','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:29 PM COT
|
||||
INSERT INTO AD_Reference (AD_Reference_ID,AD_Reference_UU,Name,EntityType,IsOrderByValue,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,UpdatedBy,AD_Client_ID,Created) VALUES (200098,'3892e140-7f08-4f89-a510-493e0f7cb775','Import Mode','D','N','L',0,100,TO_DATE('2014-12-02 16:55:29','YYYY-MM-DD HH24:MI:SS'),'Y',100,0,TO_DATE('2014-12-02 16:55:29','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:46 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200281,200098,'39b8fe8e-3d83-419d-96ce-519550cc5baf','Insert','I',100,100,TO_DATE('2014-12-02 16:55:44','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_DATE('2014-12-02 16:55:44','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:54 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200282,200098,'17e4b7b0-3699-4b98-ab13-c19fe531d4de','Update','U',100,100,TO_DATE('2014-12-02 16:55:53','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_DATE('2014-12-02 16:55:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:59 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200283,200098,'9d47e0f4-0ed4-41bb-a7d5-8dd7dc120394','Merge','M',100,100,TO_DATE('2014-12-02 16:55:59','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_DATE('2014-12-02 16:55:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:37 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,AD_Process_ID,IsMandatory,Name,ColumnName,FieldLength,IsCentrallyMaintained,SeqNo,DefaultValue,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,EntityType,Created) VALUES ('N',200113,'7c2d264e-2622-494a-81a4-03f84ea99061',200076,'Y','Import Mode','ImportMode',0,'Y',30,'I','Y',100,TO_DATE('2014-12-02 16:56:36','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,202807,17,200098,'D',TO_DATE('2014-12-02 16:56:36','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:59 PM COT
|
||||
INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,IsCentrallyMaintained,Name,AD_Menu_UU,Action,IsActive,CreatedBy,Updated,UpdatedBy,AD_Org_ID,AD_Client_ID,AD_Process_ID,EntityType,Created) VALUES (200096,'N','N','N','Y','Import CSV Process','06345362-8973-4923-85a7-e41f61289953','P','Y',100,TO_DATE('2014-12-02 16:56:59','YYYY-MM-DD HH24:MI:SS'),100,0,0,200076,'D',TO_DATE('2014-12-02 16:56:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:59 PM COT
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200096, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200096)
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53242
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53296
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=1000000
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=1000003
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=222
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=223
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=185
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=340
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53264
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53206
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=339
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=338
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53282
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=363
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=376
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=382
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=486
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=425
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=378
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=374
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53284
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=423
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53263
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=19, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=373
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=20, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=424
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=21, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200095
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=22, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200096
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 6:04:14 PM COT
|
||||
UPDATE AD_Process_Para SET AD_Reference_ID=39,Updated=TO_DATE('2014-12-02 18:04:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200112
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201412021658_IDEMPIERE-2103.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Dec 3, 2014 9:38:10 AM COT
|
||||
-- IDEMPIERE-2342 SearchDefinition - query : could show record of other tenants
|
||||
UPDATE AD_SearchDefinition SET Query='SELECT b.C_BPartner_ID FROM C_BPartner b
|
||||
INNER JOIN AD_User u ON (b.C_BPartner_ID = u.C_BPartner_ID)
|
||||
WHERE (UPPER(b.name) LIKE UPPER(?) OR UPPER(u.name) LIKE UPPER(?))
|
||||
AND b.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2014-12-03 09:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SearchDefinition_ID=50001
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201412030938_IDEMPIERE-2342.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,208 @@
|
|||
-- Dec 2, 2014 4:51:26 PM COT
|
||||
-- IDEMPIERE-2103 Process for run import/export csv
|
||||
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,Name,AD_Org_ID,UpdatedBy,IsActive,CreatedBy,Classname,Value,AD_Client_ID,EntityType,Created,Updated) VALUES ('N',200076,'N','N','95ee94ea-d050-4f20-b4f3-1b6776df6d62','7','N','N',0,0,'Y','Import CSV Process',0,100,'Y',100,'org.idempiere.process.ImportCSVProcess','ImportCSVProcess',0,'D',TO_TIMESTAMP('2014-12-02 16:51:25','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-12-02 16:51:25','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:52:29 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,AD_Process_ID,IsMandatory,Name,ColumnName,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,EntityType,Created) VALUES ('N',200111,'a75e1a11-f9e5-4d1f-9140-dde15f7c4c61',200076,'Y','Import Template','AD_ImportTemplate_ID',0,'Y',10,'Y',100,TO_TIMESTAMP('2014-12-02 16:52:28','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,202793,19,'D',TO_TIMESTAMP('2014-12-02 16:52:28','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:53:00 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,Help,AD_Process_ID,IsMandatory,Name,ColumnName,Description,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,EntityType,Created) VALUES ('N',200112,'11253af5-7dd2-441a-b1c1-2b1350e99e4e','Name of a file in the local directory space - or URL (file://.., http://.., ftp://..)',200076,'Y','File Name','FileName','Name of the local file or URL',0,'Y',20,'Y',100,TO_TIMESTAMP('2014-12-02 16:52:59','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,2295,38,'D',TO_TIMESTAMP('2014-12-02 16:52:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:07 PM COT
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType,Created) VALUES ('ImportMode',202807,'Import Mode','Import Mode','fef3fdab-e970-4c03-8789-1ae1c944ea5a',TO_TIMESTAMP('2014-12-02 16:55:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y',0,'D',TO_TIMESTAMP('2014-12-02 16:55:06','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:29 PM COT
|
||||
INSERT INTO AD_Reference (AD_Reference_ID,AD_Reference_UU,Name,EntityType,IsOrderByValue,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,UpdatedBy,AD_Client_ID,Created) VALUES (200098,'3892e140-7f08-4f89-a510-493e0f7cb775','Import Mode','D','N','L',0,100,TO_TIMESTAMP('2014-12-02 16:55:29','YYYY-MM-DD HH24:MI:SS'),'Y',100,0,TO_TIMESTAMP('2014-12-02 16:55:29','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:46 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200281,200098,'39b8fe8e-3d83-419d-96ce-519550cc5baf','Insert','I',100,100,TO_TIMESTAMP('2014-12-02 16:55:44','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_TIMESTAMP('2014-12-02 16:55:44','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:54 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200282,200098,'17e4b7b0-3699-4b98-ab13-c19fe531d4de','Update','U',100,100,TO_TIMESTAMP('2014-12-02 16:55:53','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_TIMESTAMP('2014-12-02 16:55:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:55:59 PM COT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,CreatedBy,UpdatedBy,Updated,IsActive,EntityType,AD_Client_ID,AD_Org_ID,Created) VALUES (200283,200098,'9d47e0f4-0ed4-41bb-a7d5-8dd7dc120394','Merge','M',100,100,TO_TIMESTAMP('2014-12-02 16:55:59','YYYY-MM-DD HH24:MI:SS'),'Y','D',0,0,TO_TIMESTAMP('2014-12-02 16:55:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:37 PM COT
|
||||
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,AD_Process_ID,IsMandatory,Name,ColumnName,FieldLength,IsCentrallyMaintained,SeqNo,DefaultValue,IsActive,UpdatedBy,Updated,CreatedBy,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,EntityType,Created) VALUES ('N',200113,'7c2d264e-2622-494a-81a4-03f84ea99061',200076,'Y','Import Mode','ImportMode',0,'Y',30,'I','Y',100,TO_TIMESTAMP('2014-12-02 16:56:36','YYYY-MM-DD HH24:MI:SS'),100,0,'N',0,202807,17,200098,'D',TO_TIMESTAMP('2014-12-02 16:56:36','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:59 PM COT
|
||||
INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,IsCentrallyMaintained,Name,AD_Menu_UU,"action",IsActive,CreatedBy,Updated,UpdatedBy,AD_Org_ID,AD_Client_ID,AD_Process_ID,EntityType,Created) VALUES (200096,'N','N','N','Y','Import CSV Process','06345362-8973-4923-85a7-e41f61289953','P','Y',100,TO_TIMESTAMP('2014-12-02 16:56:59','YYYY-MM-DD HH24:MI:SS'),100,0,0,200076,'D',TO_TIMESTAMP('2014-12-02 16:56:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:56:59 PM COT
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 100, statement_timestamp(), 100,t.AD_Tree_ID, 200096, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200096)
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=218
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=153
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=263
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=166
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=203
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53242
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=236
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=183
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=160
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=278
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=345
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53296
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53014
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53108
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=14, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=1000000
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=15, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=1000003
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=0, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=222
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=1, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=223
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=2, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=185
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=3, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=340
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=4, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53264
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=5, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53206
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=6, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=339
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=7, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=338
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=8, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53282
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=9, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=363
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=10, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=376
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=11, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=382
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=12, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=486
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=13, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=425
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=14, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=378
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=15, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=374
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=16, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53284
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=17, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=423
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=18, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=53263
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=19, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=373
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=20, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=424
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=21, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=200095
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 4:57:23 PM COT
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=163, SeqNo=22, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=200096
|
||||
;
|
||||
|
||||
-- Dec 2, 2014 6:04:14 PM COT
|
||||
UPDATE AD_Process_Para SET AD_Reference_ID=39,Updated=TO_TIMESTAMP('2014-12-02 18:04:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200112
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201412021658_IDEMPIERE-2103.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
-- Dec 3, 2014 9:38:10 AM COT
|
||||
-- IDEMPIERE-2342 SearchDefinition - query : could show record of other tenants
|
||||
UPDATE AD_SearchDefinition SET Query='SELECT b.C_BPartner_ID FROM C_BPartner b
|
||||
INNER JOIN AD_User u ON (b.C_BPartner_ID = u.C_BPartner_ID)
|
||||
WHERE (UPPER(b.name) LIKE UPPER(?) OR UPPER(u.name) LIKE UPPER(?))
|
||||
AND b.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2014-12-03 09:38:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_SearchDefinition_ID=50001
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201412030938_IDEMPIERE-2342.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,145 @@
|
|||
/**********************************************************************
|
||||
* This file is part of iDempiere ERP Open Source *
|
||||
* http://www.idempiere.org *
|
||||
* *
|
||||
* Copyright (C) Contributors *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, *
|
||||
* MA 02110-1301, USA. *
|
||||
* *
|
||||
* Contributors: *
|
||||
* - Hiep Le Quy *
|
||||
* - Thomas Bayen *
|
||||
* - Carlos Ruiz *
|
||||
**********************************************************************/
|
||||
|
||||
package org.idempiere.process;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.base.IGridTabImporter;
|
||||
import org.adempiere.base.equinox.EquinoxExtensionLocator;
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.GridWindow;
|
||||
import org.compiere.model.MImportTemplate;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
public class ImportCSVProcess extends SvrProcess {
|
||||
|
||||
private InputStream m_file_istream = null;
|
||||
private int p_AD_ImportTemplate_ID = 0;
|
||||
private MImportTemplate m_importTemplate;
|
||||
private String p_FileName = "";
|
||||
private String p_ImportMode = "I";
|
||||
|
||||
@Override
|
||||
protected void prepare() {
|
||||
for (ProcessInfoParameter para : getParameter()) {
|
||||
String name = para.getParameterName();
|
||||
if ("AD_ImportTemplate_ID".equals(name)) {
|
||||
p_AD_ImportTemplate_ID = para.getParameterAsInt();
|
||||
} else if ("FileName".equals(name)) {
|
||||
p_FileName = para.getParameterAsString();
|
||||
} else if ("ImportMode".equals(name)) {
|
||||
p_ImportMode = para.getParameterAsString();
|
||||
} else {
|
||||
log.log(Level.SEVERE, "Unknown Parameter: " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GridTab m_gridTab = null;
|
||||
List<GridTab> m_Childs = null;
|
||||
|
||||
@Override
|
||||
protected String doIt() throws Exception {
|
||||
|
||||
try {
|
||||
initGridTab();
|
||||
IGridTabImporter csvImport = initImporter();
|
||||
importFile (p_FileName, csvImport, m_gridTab, m_Childs);
|
||||
} finally {
|
||||
Env.clearWinContext(-1);
|
||||
}
|
||||
|
||||
return "@OK@";
|
||||
}
|
||||
|
||||
protected void initGridTab() throws Exception {
|
||||
m_importTemplate = new MImportTemplate(getCtx(), p_AD_ImportTemplate_ID, get_TrxName());
|
||||
int l_AD_Window_ID = m_importTemplate.getAD_Window_ID();
|
||||
int l_AD_Tab_ID = m_importTemplate.getAD_Tab_ID();
|
||||
|
||||
// Verify ImportMode permission for the role on the template
|
||||
if (!m_importTemplate.isAllowed(p_ImportMode, Env.getAD_Role_ID(Env.getCtx())))
|
||||
throw new AdempiereException("Template/Mode not allowed for this role");
|
||||
|
||||
GridWindow gWin = GridWindow.get(getCtx(), -1, l_AD_Window_ID);
|
||||
Env.setContext(getCtx(), -1, "IsSOTrx", gWin.isSOTrx());
|
||||
m_Childs = new ArrayList<GridTab>();
|
||||
for (int i = 0; i < gWin.getTabCount(); i++) {
|
||||
GridTab gridtab = gWin.getTab(i);
|
||||
if (!gridtab.isLoadComplete())
|
||||
gWin.initTab(i);
|
||||
if (gWin.getTab(i).getAD_Tab_ID() == l_AD_Tab_ID) {
|
||||
m_gridTab = gWin.getTab(i);
|
||||
} else {
|
||||
if (m_gridTab != null && gridtab.getTabLevel() > m_gridTab.getTabLevel())
|
||||
m_Childs.add(gridtab);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_gridTab == null)
|
||||
throw new Exception("No Active Tab");
|
||||
}
|
||||
|
||||
protected IGridTabImporter initImporter() throws Exception {
|
||||
IGridTabImporter csvImport = null;
|
||||
List<IGridTabImporter> importerList = EquinoxExtensionLocator.instance().list(IGridTabImporter.class).getExtensions();
|
||||
for (IGridTabImporter importer : importerList){
|
||||
if ("csv".equals(importer.getFileExtension())) {
|
||||
csvImport = importer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (csvImport == null)
|
||||
throw new Exception ("No CSV importer");
|
||||
|
||||
return csvImport;
|
||||
}
|
||||
|
||||
protected void importFile(String filePath, IGridTabImporter csvImporter, GridTab activeTab, List<GridTab> childTabs) throws Exception {
|
||||
m_file_istream = new FileInputStream(filePath);
|
||||
|
||||
File outFile = csvImporter.fileImport(activeTab, childTabs, m_file_istream, Charset.forName(m_importTemplate.getCharacterSet()), p_ImportMode);
|
||||
// TODO: Potential improvement - traverse the outFile and call addLog with the results
|
||||
|
||||
if (processUI != null)
|
||||
processUI.download(outFile);
|
||||
|
||||
m_file_istream.close();
|
||||
}
|
||||
|
||||
}
|
|
@ -599,8 +599,9 @@ public class GridTabCSVImporter implements IGridTabImporter
|
|||
}
|
||||
} catch (IOException e) {
|
||||
throw new AdempiereException(e);
|
||||
}
|
||||
finally {
|
||||
} catch (Exception ex) {
|
||||
throw new AdempiereException(ex);
|
||||
} finally {
|
||||
try {
|
||||
if (mapReader != null)
|
||||
mapReader.close();
|
||||
|
@ -1296,6 +1297,7 @@ public class GridTabCSVImporter implements IGridTabImporter
|
|||
}
|
||||
|
||||
//Copy from GridTable
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean isValueChanged(Object oldValue, Object value)
|
||||
{
|
||||
if ( isNotNullAndIsEmpty(oldValue) ) {
|
||||
|
|
|
@ -155,6 +155,7 @@ public abstract class AbstractDocumentSearch {
|
|||
} else {
|
||||
sqlSO.append("WHERE UPPER(").append(column.getColumnName()).append(") LIKE UPPER(?)");
|
||||
}
|
||||
sqlSO.append(Env.parseContext(Env.getCtx(), -1, " AND AD_Client_ID=@#AD_Client_ID@", false, true));
|
||||
|
||||
if (msd.getPO_Window_ID() != 0) {
|
||||
sqlPO = new StringBuilder(sqlSO.toString()).append(" AND IsSOTrx='N'");
|
||||
|
@ -170,14 +171,20 @@ public abstract class AbstractDocumentSearch {
|
|||
}
|
||||
// search for a String
|
||||
} else if (msd.getDataType().equals(MSearchDefinition.DATATYPE_STRING)) {
|
||||
pstmtSO.setString(1, searchString);
|
||||
if (searchString.endsWith("%"))
|
||||
pstmtSO.setString(1, searchString);
|
||||
else
|
||||
pstmtSO.setString(1, searchString+"%");
|
||||
if (msd.getPO_Window_ID() != 0) {
|
||||
pstmtPO.setString(1, searchString);
|
||||
if (searchString.endsWith("%"))
|
||||
pstmtPO.setString(1, searchString);
|
||||
else
|
||||
pstmtPO.setString(1, searchString+"%");
|
||||
}
|
||||
}
|
||||
// SearchDefinition with a special query
|
||||
} else if (msd.getSearchType().equals(MSearchDefinition.SEARCHTYPE_QUERY)) {
|
||||
sqlSO = new StringBuilder().append(msd.getQuery());
|
||||
sqlSO = new StringBuilder().append(Env.parseContext(Env.getCtx(), -1, msd.getQuery(), false, true));
|
||||
pstmtSO = DB.prepareStatement(sqlSO.toString(), null);
|
||||
// count '?' in statement
|
||||
int count = 1;
|
||||
|
@ -190,7 +197,10 @@ public abstract class AbstractDocumentSearch {
|
|||
if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) {
|
||||
pstmtSO.setInt(i, Integer.valueOf(searchString.replaceAll("\\D", "")));
|
||||
} else if (msd.getDataType().equals(MSearchDefinition.DATATYPE_STRING)) {
|
||||
pstmtSO.setString(i, searchString);
|
||||
if (searchString.endsWith("%"))
|
||||
pstmtSO.setString(i, searchString);
|
||||
else
|
||||
pstmtSO.setString(i, searchString+"%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,10 +200,14 @@ public class GridFieldVO implements Serializable
|
|||
vo.AD_Reference_Value_ID = rs.getInt(i);
|
||||
else if (columnName.equalsIgnoreCase("ValidationCode"))
|
||||
vo.ValidationCode = rs.getString(i);
|
||||
else if (columnName.equalsIgnoreCase("ColumnSQL"))
|
||||
else if (columnName.equalsIgnoreCase("ColumnSQL")) {
|
||||
vo.ColumnSQL = rs.getString(i);
|
||||
if (vo.ColumnSQL != null && vo.ColumnSQL.contains("@")) {
|
||||
// NOTE: cannot use window context because this is set globally on the query, not per record
|
||||
vo.ColumnSQL = Env.parseContext(ctx, -1, vo.ColumnSQL, false, true);
|
||||
}
|
||||
//Feature Request FR [ 1757088 ]
|
||||
else if (columnName.equalsIgnoreCase("Included_Tab_ID"))
|
||||
} else if (columnName.equalsIgnoreCase("Included_Tab_ID"))
|
||||
vo.Included_Tab_ID = rs.getInt(i);
|
||||
// Collapse Default State
|
||||
else if (columnName.equalsIgnoreCase("IsCollapsedByDefault"))
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.Properties;
|
|||
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
|
@ -33,7 +34,7 @@ public class MImportTemplate extends X_AD_ImportTemplate
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 3316290883489953101L;
|
||||
private static final long serialVersionUID = -1207697938690504067L;
|
||||
|
||||
/** Logger */
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -96,4 +97,21 @@ public class MImportTemplate extends X_AD_ImportTemplate
|
|||
return retValue;
|
||||
}
|
||||
|
||||
public boolean isAllowed(String importMode, int roleID) {
|
||||
StringBuilder sql= new StringBuilder(
|
||||
"SELECT COUNT(*) FROM AD_ImportTemplateAccess WHERE IsActive='Y' AND AD_ImportTemplate_ID=? AND AD_Role_ID=? AND IsAllow");
|
||||
if ("I".equals(importMode))
|
||||
sql.append("Insert");
|
||||
else if ("U".equals(importMode))
|
||||
sql.append("Update");
|
||||
else if ("M".equals(importMode))
|
||||
sql.append("Merge");
|
||||
else
|
||||
return false;
|
||||
sql.append("='Y'");
|
||||
|
||||
int cnt = DB.getSQLValueEx(get_TrxName(), sql.toString(), getAD_ImportTemplate_ID(), roleID);
|
||||
return cnt > 0;
|
||||
}
|
||||
|
||||
} // MImportTemplate
|
||||
|
|
|
@ -417,6 +417,8 @@ public class MLookupFactory
|
|||
ZoomWindowPO = rs.getInt(9);
|
||||
//AD_Table_ID = rs.getInt(10);
|
||||
displayColumnSQL = rs.getString(11);
|
||||
if (displayColumnSQL != null && displayColumnSQL.contains("@"))
|
||||
displayColumnSQL = Env.parseContext(Env.getCtx(), -1, displayColumnSQL, false, true);
|
||||
overrideZoomWindow = rs.getInt(12);
|
||||
infoWindowId = rs.getInt(13);
|
||||
loaded = true;
|
||||
|
|
|
@ -1162,7 +1162,7 @@ public class MMatchPO extends X_M_MatchPO
|
|||
|
||||
public boolean reverse(Timestamp reversalDate)
|
||||
{
|
||||
if (this.isPosted() && this.getReversal_ID() == 0)
|
||||
if (this.isProcessed() && this.getReversal_ID() == 0)
|
||||
{
|
||||
MMatchPO reversal = new MMatchPO (getCtx(), 0, get_TrxName());
|
||||
reversal.setC_InvoiceLine_ID(getC_InvoiceLine_ID());
|
||||
|
|
|
@ -2405,6 +2405,10 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
so.setLink_Order_ID(0);
|
||||
so.saveEx();
|
||||
}
|
||||
|
||||
if (!createReversals())
|
||||
return false;
|
||||
|
||||
MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID);
|
||||
for (int i = 0; i < lines.length; i++)
|
||||
{
|
||||
|
@ -2448,9 +2452,6 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
// UnLink All Requisitions
|
||||
MRequisitionLine.unlinkC_Order_ID(getCtx(), get_ID(), get_TrxName());
|
||||
|
||||
if (!createReversals())
|
||||
return false;
|
||||
|
||||
/* globalqss - 2317928 - Reactivating/Voiding order must reset posted */
|
||||
MFactAcct.deleteEx(MOrder.Table_ID, getC_Order_ID(), get_TrxName());
|
||||
setPosted(false);
|
||||
|
@ -2551,7 +2552,7 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
|
||||
/**
|
||||
* Close Document.
|
||||
* Cancel not delivered Qunatities
|
||||
* Cancel not delivered Quantities
|
||||
* @return true if success
|
||||
*/
|
||||
public boolean closeIt()
|
||||
|
|
|
@ -1114,7 +1114,10 @@ class Restriction implements Serializable
|
|||
MTable table = MTable.get(Env.getCtx(), tableName);
|
||||
if (table != null) {
|
||||
for (MColumn col : table.getColumns(false)) {
|
||||
if (ColumnName.equals(col.getColumnSQL())) {
|
||||
String colSQL = col.getColumnSQL();
|
||||
if (colSQL != null && colSQL.contains("@"))
|
||||
colSQL = Env.parseContext(Env.getCtx(), -1, colSQL, false, true);
|
||||
if (ColumnName.equals(colSQL)) {
|
||||
virtualColumn = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8965976274227777648L;
|
||||
private static final long serialVersionUID = 2907227045981641758L;
|
||||
|
||||
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
|
||||
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
|
||||
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
|
||||
public static final String ALLOW_APPLY_PAYMENT_TO_CREDITMEMO = "ALLOW_APPLY_PAYMENT_TO_CREDITMEMO";
|
||||
public static final String ALLOW_OVER_APPLIED_PAYMENT = "ALLOW_OVER_APPLIED_PAYMENT";
|
||||
|
@ -95,6 +95,7 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
public static final String MAIL_SEND_BCC_TO_FROM = "MAIL_SEND_BCC_TO_FROM";
|
||||
public static final String MAIL_SEND_CREDENTIALS = "MAIL_SEND_CREDENTIALS";
|
||||
public static final String MAX_ACTIVITIES_IN_LIST = "MAX_ACTIVITIES_IN_LIST";
|
||||
public static final String MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER = "MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER";
|
||||
public static final String MENU_INFOUPDATER_SLEEP_MS = "MENU_INFOUPDATER_SLEEP_MS";
|
||||
public static final String MFG_ValidateCostsDifferenceOnCreate = "MFG_ValidateCostsDifferenceOnCreate";
|
||||
public static final String MFG_ValidateCostsOnCreate = "MFG_ValidateCostsOnCreate";
|
||||
|
|
|
@ -198,6 +198,8 @@ public class POInfo implements Serializable
|
|||
//
|
||||
m_AccessLevel = rs.getString(18);
|
||||
String ColumnSQL = rs.getString(19);
|
||||
if (ColumnSQL != null && ColumnSQL.contains("@"))
|
||||
ColumnSQL = Env.parseContext(Env.getCtx(), -1, ColumnSQL, false, true);
|
||||
boolean IsEncrypted = "Y".equals(rs.getString(20));
|
||||
boolean IsAllowLogging = "Y".equals(rs.getString(21));
|
||||
boolean IsAllowCopy = "Y".equals(rs.getString(22));
|
||||
|
|
|
@ -122,6 +122,7 @@ public class SystemIDs
|
|||
public final static int REFERENCE_YESNO = 319;
|
||||
public final static int REFERENCE_WIZARDSTATUS = 200003;
|
||||
public final static int REFERENCE_WFINSTANCE_STATE = 305;
|
||||
public final static int REFERENCE_IMPORT_MODE = 200098;
|
||||
|
||||
public final static int TABLE_AD_TABLE = 100;
|
||||
public final static int TABLE_AD_WF_PROCESS = 645;
|
||||
|
|
|
@ -299,6 +299,8 @@ public class DataEngine
|
|||
int AD_Column_ID = rs.getInt(1);
|
||||
String ColumnName = rs.getString(2);
|
||||
String ColumnSQL = rs.getString(24);
|
||||
if (ColumnSQL != null && ColumnSQL.contains("@"))
|
||||
ColumnSQL = Env.parseContext(Env.getCtx(), -1, ColumnSQL, false, true);
|
||||
if (ColumnSQL == null)
|
||||
ColumnSQL = "";
|
||||
int AD_Reference_ID = rs.getInt(3);
|
||||
|
|
|
@ -22,12 +22,14 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.sql.Timestamp;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
import java.text.AttributedString;
|
||||
import java.text.Normalizer;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.ActionMap;
|
||||
|
@ -237,7 +239,19 @@ public class Util
|
|||
else
|
||||
return str.length() == 0;
|
||||
} // isEmpty
|
||||
|
||||
|
||||
/**
|
||||
* Remove accents from string
|
||||
* @param str string
|
||||
* @return Unaccented String
|
||||
*/
|
||||
public static String deleteAccents(String text) {
|
||||
String nfdNormalizedString = Normalizer.normalize(text, Normalizer.Form.NFD);
|
||||
Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
|
||||
text = pattern.matcher(nfdNormalizedString).replaceAll("");
|
||||
return text;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Find index of search character in str.
|
||||
* This ignores content in () and 'texts'
|
||||
|
|
|
@ -256,6 +256,8 @@ public class InfoGeneral extends Info
|
|||
{
|
||||
m_queryColumns.add(rs.getString(1));
|
||||
String columnSql = rs.getString(4);
|
||||
if (columnSql != null && columnSql.contains("@"))
|
||||
columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true);
|
||||
if (columnSql != null && columnSql.length() > 0)
|
||||
m_queryColumnsSql.add(columnSql);
|
||||
else
|
||||
|
@ -325,6 +327,8 @@ public class InfoGeneral extends Info
|
|||
int AD_Reference_Value_ID = rs.getInt(5);
|
||||
// teo_sarca
|
||||
String columnSql = rs.getString(6);
|
||||
if (columnSql != null && columnSql.contains("@"))
|
||||
columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true);
|
||||
if (columnSql == null || columnSql.length() == 0)
|
||||
columnSql = columnName;
|
||||
// Default
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5540268492066600133L;
|
||||
private static final long serialVersionUID = -9183846974546235806L;
|
||||
|
||||
public static final String BTNPREFIX = "Btn";
|
||||
|
||||
|
@ -476,6 +476,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
|
|||
return !btnDelete.isDisabled();
|
||||
}
|
||||
|
||||
public boolean isNewEnabled() {
|
||||
return !btnNew.isDisabled();
|
||||
}
|
||||
|
||||
public void enableIgnore(boolean enabled)
|
||||
{
|
||||
this.btnIgnore.setDisabled(!enabled);
|
||||
|
|
|
@ -1279,7 +1279,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
}
|
||||
|
||||
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew());
|
||||
toolbar.enableCSVImport(adTabbox.getSelectedGridTab().hasTemplate());
|
||||
|
||||
//Deepak-Enabling customize button IDEMPIERE-364
|
||||
if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab))
|
||||
|
@ -1623,7 +1622,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !isNewRow);
|
||||
toolbar.enableReport(!isNewRow);
|
||||
toolbar.enableExport(!isNewRow && !adTabbox.getSelectedGridTab().isSortTab());
|
||||
toolbar.enableFileImport(!isNewRow && !changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord());
|
||||
toolbar.enableFileImport(toolbar.isNewEnabled());
|
||||
toolbar.enableCSVImport(toolbar.isNewEnabled() && adTabbox.getSelectedGridTab().hasTemplate());
|
||||
|
||||
toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null);
|
||||
|
||||
|
|
|
@ -216,9 +216,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
|||
return true;
|
||||
}
|
||||
|
||||
MProcess process = new MProcess(m_ctx, m_AD_Process_ID, null);
|
||||
boolean isReport = (process.isReport() || process.getAD_ReportView_ID() > 0);
|
||||
if (isReport && MSysConfig.getBooleanValue(MSysConfig.BACKGROUND_JOB_ALLOWED, false))
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.BACKGROUND_JOB_ALLOWED, false))
|
||||
{
|
||||
Grid grid = GridFactory.newGridLayout();
|
||||
centerPanel.appendChild(grid);
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.compiere.model.MLookupInfo;
|
|||
import org.compiere.model.MQuery;
|
||||
import org.compiere.model.MRole;
|
||||
import org.compiere.model.MSearchDefinition;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.MWindow;
|
||||
import org.compiere.model.Query;
|
||||
|
@ -53,6 +54,7 @@ public class DocumentSearchController implements EventListener<Event>{
|
|||
|
||||
private static final String SEARCH_RESULT = "search.result";
|
||||
private static final String ON_SEARCH_DOCUMENTS = "onSearchDocuments";
|
||||
private int MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER = 3;
|
||||
private Vlayout layout;
|
||||
private ArrayList<SearchResult> list;
|
||||
private int selected = -1;
|
||||
|
@ -61,6 +63,7 @@ public class DocumentSearchController implements EventListener<Event>{
|
|||
*
|
||||
*/
|
||||
public DocumentSearchController() {
|
||||
MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER = MSysConfig.getIntValue(MSysConfig.MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER, 3, Env.getAD_Client_ID(Env.getCtx()));
|
||||
}
|
||||
|
||||
public void create(Component parent) {
|
||||
|
@ -119,7 +122,7 @@ public class DocumentSearchController implements EventListener<Event>{
|
|||
final MRole role = MRole.get(Env.getCtx(), Env.getAD_Role_ID(Env.getCtx()), Env.getAD_User_ID(Env.getCtx()), true);
|
||||
|
||||
selected = -1;
|
||||
Query query = new Query(Env.getCtx(), I_AD_SearchDefinition.Table_Name, "", null);
|
||||
Query query = new Query(Env.getCtx(), I_AD_SearchDefinition.Table_Name, "TransactionCode IS NULL", null);
|
||||
List<MSearchDefinition> definitions = query.setOnlyActiveRecords(true).list();
|
||||
for(MSearchDefinition msd : definitions) {
|
||||
MTable table = new MTable(Env.getCtx(), msd.getAD_Table_ID(), null);
|
||||
|
@ -144,7 +147,7 @@ public class DocumentSearchController implements EventListener<Event>{
|
|||
} else {
|
||||
sql.append("WHERE UPPER(").append(column.getColumnName()).append(") LIKE UPPER(?)");
|
||||
}
|
||||
sql.append(" AND AD_Client_ID=@AD_Client_ID@ ");
|
||||
sql.append(" AND AD_Client_ID=@#AD_Client_ID@ ");
|
||||
|
||||
// search for a Integer
|
||||
if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) {
|
||||
|
@ -216,7 +219,7 @@ public class DocumentSearchController implements EventListener<Event>{
|
|||
pstmt.setQueryTimeout(1);
|
||||
rs = pstmt.executeQuery();
|
||||
int count = 0;
|
||||
while (rs.next() && count < 3) {
|
||||
while (rs.next() && count < MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER) {
|
||||
count++;
|
||||
int id = rs.getInt(1);
|
||||
SearchResult result = new SearchResult();
|
||||
|
|
|
@ -84,4 +84,9 @@ public class MenuItem {
|
|||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return label != null ? label : super.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ public class MenuSearchController implements EventListener<Event>{
|
|||
}
|
||||
|
||||
public void search(String value) {
|
||||
listbox.setModel((ListModel)null);
|
||||
listbox.setModel((ListModel<?>)null);
|
||||
Events.echoEvent(ON_SEARCH_ECHO, layout, value);
|
||||
}
|
||||
|
||||
|
@ -349,20 +349,20 @@ public class MenuSearchController implements EventListener<Event>{
|
|||
private String compare;
|
||||
|
||||
private MenuListComparator(String compare) {
|
||||
this.compare = compare;
|
||||
this.compare = Util.deleteAccents(compare.toLowerCase().trim());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(MenuItem o1, MenuItem o2) {
|
||||
compare = compare.toLowerCase().trim();
|
||||
String label2 = Util.deleteAccents(o2.getLabel().toLowerCase());
|
||||
boolean match = false;
|
||||
if (compare.length() < 3)
|
||||
{
|
||||
match = o2.getLabel().toLowerCase().startsWith(compare);
|
||||
match = label2.startsWith(compare);
|
||||
}
|
||||
else
|
||||
{
|
||||
match = o2.getLabel().toLowerCase().contains(compare);
|
||||
match = label2.contains(compare);
|
||||
}
|
||||
return match ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
*****************************************************************************/
|
||||
package org.adempiere.webui.apps.form;
|
||||
|
||||
import java.text.Normalizer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.adempiere.util.Callback;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
|
@ -43,6 +41,7 @@ import org.compiere.model.MTreeNode;
|
|||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Util;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
@ -262,17 +261,10 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
|
|||
|
||||
private void searchElement() {
|
||||
String filter = searchBox.getText() == null ? "" : searchBox.getText();
|
||||
filter = deleteAccents(filter.trim().toUpperCase());
|
||||
filter = Util.deleteAccents(filter.trim().toUpperCase());
|
||||
action_loadTree(filter);
|
||||
}
|
||||
|
||||
private String deleteAccents(String text) {
|
||||
String nfdNormalizedString = Normalizer.normalize(text, Normalizer.Form.NFD);
|
||||
Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
|
||||
text = pattern.matcher(nfdNormalizedString).replaceAll("");
|
||||
return text;
|
||||
}
|
||||
|
||||
private void action_loadTree() {
|
||||
action_loadTree(null);
|
||||
}
|
||||
|
@ -304,9 +296,13 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
|
|||
SimpleListModel model = new SimpleListModel();
|
||||
ArrayList<ListItem> items = getTreeItemData();
|
||||
for (ListItem item : items) {
|
||||
String valueItem = item.toString() == null ? "" : deleteAccents(item.toString().toUpperCase());
|
||||
if (filter == null || filter.length() == 0 || valueItem.contains(filter)) {
|
||||
if (Util.isEmpty(filter)) {
|
||||
model.addElement(item);
|
||||
} else {
|
||||
String valueItem = item.toString() == null ? "" : Util.deleteAccents(item.toString().toUpperCase());
|
||||
if (valueItem.contains(filter)) {
|
||||
model.addElement(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ package org.adempiere.webui.apps.graph;
|
|||
|
||||
import java.awt.Point;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -33,7 +34,9 @@ import org.compiere.model.MLookupInfo;
|
|||
import org.compiere.model.MMeasure;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.zhtml.A;
|
||||
import org.zkoss.zhtml.Br;
|
||||
import org.zkoss.zhtml.Table;
|
||||
|
@ -97,6 +100,8 @@ public class WGraph extends Div implements IdSpace {
|
|||
private String m_xAxisLabel;
|
||||
|
||||
private String m_yAxisLabel;
|
||||
|
||||
public DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -393,14 +398,14 @@ public class WGraph extends Div implements IdSpace {
|
|||
Td td = new Td();
|
||||
td.setSclass("pa-label");
|
||||
tr.appendChild(td);
|
||||
Text text = new Text("Target");
|
||||
Text text = new Text(Msg.getElement(Env.getCtx(), "MeasureTarget"));
|
||||
td.appendChild(text);
|
||||
td = new Td();
|
||||
td.setDynamicProperty("colspan", "2");
|
||||
td.setSclass("pa-tdcontent");
|
||||
tr.appendChild(td);
|
||||
text = new Text(m_goal.getMeasureTarget().setScale(2,
|
||||
BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
text = new Text(format.format(m_goal.getMeasureTarget().setScale(2,
|
||||
BigDecimal.ROUND_HALF_UP)));
|
||||
td.appendChild(text);
|
||||
|
||||
tr = new Tr();
|
||||
|
@ -408,14 +413,14 @@ public class WGraph extends Div implements IdSpace {
|
|||
td = new Td();
|
||||
td.setSclass("pa-label");
|
||||
tr.appendChild(td);
|
||||
text = new Text("Actual");
|
||||
text = new Text(Msg.getElement(Env.getCtx(), "MeasureActual"));
|
||||
td.appendChild(text);
|
||||
td = new Td();
|
||||
td.setDynamicProperty("colspan", "2");
|
||||
td.setSclass("pa-tdcontent");
|
||||
tr.appendChild(td);
|
||||
text = new Text(m_goal.getMeasureActual().setScale(2,
|
||||
BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
text = new Text(format.format(m_goal.getMeasureActual().setScale(2,
|
||||
BigDecimal.ROUND_HALF_UP)));
|
||||
td.appendChild(text);
|
||||
|
||||
GraphColumn[] bList = getGraphColumnList();
|
||||
|
@ -466,11 +471,11 @@ public class WGraph extends Div implements IdSpace {
|
|||
|
||||
});
|
||||
a.setDynamicProperty("href", "javascript:;");
|
||||
text = new Text(value.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
text = new Text(format.format(value.setScale(2, BigDecimal.ROUND_HALF_UP)));
|
||||
a.appendChild(text);
|
||||
|
||||
} else {
|
||||
text = new Text(value.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
text = new Text(format.format(value.setScale(2, BigDecimal.ROUND_HALF_UP)));
|
||||
}
|
||||
}
|
||||
tr = new Tr();
|
||||
|
|
|
@ -301,7 +301,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
|
|||
{
|
||||
m_queryColumns.add(rs.getString(1));
|
||||
String columnSql = rs.getString(4);
|
||||
|
||||
if (columnSql != null && columnSql.contains("@"))
|
||||
columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true);
|
||||
if (columnSql != null && columnSql.length() > 0)
|
||||
m_queryColumnsSql.add(columnSql);
|
||||
else
|
||||
|
@ -378,7 +379,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
|
|||
boolean isDisplayed = rs.getString(4).equals("Y");
|
||||
int AD_Reference_Value_ID = rs.getInt(5);
|
||||
String columnSql = rs.getString(6);
|
||||
|
||||
if (columnSql != null && columnSql.contains("@"))
|
||||
columnSql = Env.parseContext(Env.getCtx(), -1, columnSql, false, true);
|
||||
if (columnSql == null || columnSql.length() == 0)
|
||||
columnSql = columnName;
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
*****************************************************************************/
|
||||
package org.adempiere.webui.panel.action;
|
||||
|
||||
import static org.compiere.model.SystemIDs.REFERENCE_IMPORT_MODE;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -44,13 +46,18 @@ import org.adempiere.webui.component.Listbox;
|
|||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.component.Window;
|
||||
import org.adempiere.webui.editor.WTableDirEditor;
|
||||
import org.adempiere.webui.event.DialogEvents;
|
||||
import org.adempiere.webui.util.ReaderInputStream;
|
||||
import org.adempiere.webui.window.FDialog;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.model.MLookupFactory;
|
||||
import org.compiere.model.MLookupInfo;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Ini;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Util;
|
||||
import org.zkoss.util.media.AMedia;
|
||||
import org.zkoss.util.media.Media;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
|
@ -80,7 +87,7 @@ public class FileImportAction implements EventListener<Event>
|
|||
private Listbox cboType = new Listbox();
|
||||
private Button bFile = new Button();
|
||||
private Listbox fCharset = new Listbox();
|
||||
private Listbox fImportMode = new Listbox();
|
||||
private WTableDirEditor fImportMode;
|
||||
private InputStream m_file_istream = null;
|
||||
|
||||
/**
|
||||
|
@ -115,10 +122,9 @@ public class FileImportAction implements EventListener<Event>
|
|||
}
|
||||
fCharset.addEventListener(Events.ON_SELECT, this);
|
||||
|
||||
fImportMode.appendItem("Insert","I");
|
||||
fImportMode.appendItem("Update","U");
|
||||
fImportMode.appendItem("Merge","M");
|
||||
fImportMode.setSelectedIndex(0);
|
||||
MLookupInfo lookupInfo = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), REFERENCE_IMPORT_MODE);
|
||||
MLookup lookup = new MLookup(lookupInfo, 0);
|
||||
fImportMode = new WTableDirEditor("ImportMode",true,false,true,lookup);
|
||||
|
||||
importerMap = new HashMap<String, IGridTabImporter>();
|
||||
extensionMap = new HashMap<String, String>();
|
||||
|
@ -195,11 +201,7 @@ public class FileImportAction implements EventListener<Event>
|
|||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.appendChild(new Label(Msg.getMsg(Env.getCtx(), "import.mode", true)));
|
||||
fImportMode.setMold("select");
|
||||
fImportMode.setRows(0);
|
||||
fImportMode.setTooltiptext(Msg.getMsg(Env.getCtx(), "import.mode", false));
|
||||
row.appendChild(fImportMode);
|
||||
fImportMode.setHflex("1");
|
||||
row.appendChild(fImportMode.getComponent());
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
|
@ -242,7 +244,7 @@ public class FileImportAction implements EventListener<Event>
|
|||
Executions.getCurrent().getDesktop().getWebApp().getConfiguration().setUploadCharset(charset.name());
|
||||
bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile"));
|
||||
} else if (event.getTarget().getId().equals(ConfirmPanel.A_OK)) {
|
||||
if (m_file_istream == null || fCharset.getSelectedItem() == null)
|
||||
if (m_file_istream == null || fCharset.getSelectedItem() == null || Util.isEmpty((String)fImportMode.getValue()))
|
||||
return;
|
||||
importFile();
|
||||
} else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) {
|
||||
|
@ -321,11 +323,7 @@ public class FileImportAction implements EventListener<Event>
|
|||
return;
|
||||
charset = (Charset)listitem.getValue();
|
||||
|
||||
ListItem importItem = fImportMode.getSelectedItem();
|
||||
if (importItem == null)
|
||||
return;
|
||||
|
||||
String iMode = (String)importItem.getValue();
|
||||
String iMode = (String) fImportMode.getValue();
|
||||
File outFile = importer.fileImport(panel.getActiveGridTab(), childs, m_file_istream, charset,iMode);
|
||||
winImportFile.onClose();
|
||||
winImportFile = null;
|
||||
|
|
|
@ -718,7 +718,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
|
|||
lsPart.add(startString);
|
||||
|
||||
// no image in sign return origon
|
||||
if (lsPart.size() < 0){
|
||||
if (lsPart.size() == 0 || lsImgSrc.size() == 0){
|
||||
return origonSign;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue