IDEMPIERE-5259 Labels feature (#1357)

* IDEMPIERE-5259 Labels feature
* IDEMPIERE-5259 Update the theme version timestamp
* IDEMPIERE-5259 Better javadoc
* Update 202205131118_IDEMPIERE-5259.sql
* Update 202205131118_IDEMPIERE-5259.sql
* IDEMPIERE-5259 New window Label Assignment
* IDEMPIERE-5259 Toggle issue
* IDEMPIERE-5259 MSysConfig is ordered alphabetically
* IDEMPIERE-5259 Default SysConfig
* IDEMPIERE-5259 Avoid duplicated records
Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Alan Lescano 2022-08-01 16:51:38 -03:00 committed by GitHub
parent c62a9ad066
commit 11962e1713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 5563 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,109 @@
-- IDEMPIERE-5259 New window Label Assignment
SELECT register_migration_script('202206241449_IDEMPIERE-5259.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jun 24, 2022, 2:49:05 PM BRT
INSERT INTO AD_Window (AD_Window_ID,Name,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,WindowType,Processing,EntityType,IsSOTrx,IsDefault,WinHeight,WinWidth,IsBetaFunctionality,AD_Window_UU) VALUES (200130,'Label Assignment',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:49:05','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:49:05','YYYY-MM-DD HH24:MI:SS'),10,'M','N','D','N','N',0,0,'N','592aed77-8bce-4903-8b77-ad839869a525')
;
-- Jun 24, 2022, 2:50:25 PM BRT
INSERT INTO AD_Tab (AD_Tab_ID,Name,AD_Window_ID,SeqNo,IsSingleRow,AD_Table_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,HasTree,IsInfoTab,IsTranslationTab,IsReadOnly,Processing,ImportFields,TabLevel,IsSortTab,EntityType,IsInsertRecord,IsAdvancedTab,AD_Tab_UU,TreeDisplayedOn,IsLookupOnlySelection,IsAllowAdvancedLookup,MaxQueryRecords) VALUES (200324,'Assignment',200130,10,'Y',200347,0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:25','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:25','YYYY-MM-DD HH24:MI:SS'),10,'N','N','N','N','N','N',0,'N','D','Y','N','379bc7ea-82fb-4be7-867e-17706d30d156','B','N','Y',0)
;
-- Jun 24, 2022, 2:50:38 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207100,'Tenant','Tenant for this installation.','A Tenant is a company or a legal entity. You cannot share data between Tenants.',200324,214893,'Y',22,10,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','358c70ff-aec5-4677-aacb-9e335675d5b6','Y',10,2)
;
-- Jun 24, 2022, 2:50:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsAllowCopy,IsDisplayedGrid,XPosition,ColumnSpan) VALUES (207101,'Organization','Organizational entity within tenant','An organization is a unit of your tenant or legal entity - examples are store, department. You can share data between organizations.',200324,214894,'Y',22,20,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','25b2fc93-0c1e-4110-a073-bb41f9557aaa','Y','N',4,2)
;
-- Jun 24, 2022, 2:50:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207102,'Description','Optional short description of the record','A description is limited to 255 characters.',200324,214900,'Y',255,30,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','1ddb9684-ad07-42d8-a636-fb79088e7463','Y',20,5)
;
-- Jun 24, 2022, 2:50:40 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,ColumnSpan) VALUES (207103,'Label Assignment',200324,214891,'N',22,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','b017a1fb-6746-490d-bac0-bbb27e927cae','N',2)
;
-- Jun 24, 2022, 2:50:40 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207104,'Label Assignment',200324,214892,'Y',36,40,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','28742ba6-5278-4575-8511-2e0ad1ed68d5','Y',30,2)
;
-- Jun 24, 2022, 2:50:41 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207105,'Label','Record Label',200324,214901,'Y',22,50,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','8cdcaee7-69df-470b-80d0-6ee4ef9a2b5f','Y',40,2)
;
-- Jun 24, 2022, 2:50:41 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207106,'Table','Database Table information','The Database Table provides the information of the table definition',200324,214902,'Y',10,60,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','b6395b2e-fbeb-4f6c-ab4d-fb8215386427','Y',50,2)
;
-- Jun 24, 2022, 2:50:42 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,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) VALUES (207107,'Record ID','Direct internal record ID','The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.',200324,214903,'Y',22,70,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','4d74432a-d903-4c46-86bb-816d904836e5','Y',60,2,2)
;
-- Jun 24, 2022, 2:50:42 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,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) VALUES (207108,'Active','The record is active in the system','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.',200324,214899,'Y',1,80,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:42','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:42','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','03e15bd2-379c-4cc7-a1c8-62e9fcac125d','Y',70,2,2)
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=40, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207108
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET IsDisplayed='N', SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207104
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207103
;
-- Jun 24, 2022, 2:55:00 PM BRT
UPDATE AD_Table SET AD_Window_ID=200130,Updated=TO_TIMESTAMP('2022-06-24 14:55:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Table_ID=200347
;
-- Jun 24, 2022, 2:55:52 PM BRT
INSERT INTO AD_Menu (AD_Menu_ID,Name,Action,AD_Window_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,AD_Menu_UU) VALUES (200208,'Label Assignment','W',200130,0,0,'Y',TO_TIMESTAMP('2022-06-24 14:55:51','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:55:51','YYYY-MM-DD HH24:MI:SS'),10,'N','N','N','D','Y','0e5d5883-2839-46c8-993a-24ea51a20b61')
;
-- Jun 24, 2022, 2:55:52 PM BRT
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', getDate(), 10, getDate(), 10,t.AD_Tree_ID, 200208, 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=200208)
;
-- Jun 24, 2022, 2:56:08 PM BRT
UPDATE AD_TreeNodeMM SET Parent_ID=153, SeqNo=37,Updated=TO_TIMESTAMP('2022-06-24 14:56:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Tree_ID=10 AND Node_ID=200208
;
-- Jun 24, 2022, 2:56:08 PM BRT
UPDATE AD_TreeNodeMM SET Parent_ID=153, SeqNo=38,Updated=TO_TIMESTAMP('2022-06-24 14:56:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Tree_ID=10 AND Node_ID=50001
;
-- Jun 24, 2022, 2:59:40 PM BRT
UPDATE AD_Column SET IsToolbarButton='N',Updated=TO_TIMESTAMP('2022-06-24 14:59:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214903
;
-- Jun 24, 2022, 3:00:20 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=5, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 15:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207107
;
-- Jun 24, 2022, 3:02:56 PM BRT
UPDATE AD_Column SET IsSelectionColumn='Y', SeqNoSelection=20,Updated=TO_TIMESTAMP('2022-06-24 15:02:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214902
;
-- Jun 24, 2022, 3:03:08 PM BRT
UPDATE AD_Column SET IsSelectionColumn='Y', SeqNoSelection=30,Updated=TO_TIMESTAMP('2022-06-24 15:03:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214901
;
-- Jun 24, 2022, 3:05:58 PM BRT
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2022-06-24 15:05:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214900
;
-- Jun 24, 2022, 3:10:01 PM BRT
UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2022-06-24 15:10:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214901
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-5259 Default SysConfig
SELECT register_migration_script('202206291714_IDEMPIERE-5259.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jun 29, 2022, 5:14:48 PM BRT
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 (200201,0,0,TO_TIMESTAMP('2022-06-29 17:14:46','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-06-29 17:14:46','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','LABEL_AUTOMATIC_COLOR','Y','Y/N - Define if the application will automatically colorize labels, even if not assigned to a CSS style','D','C','10c6845f-9ce8-4ad7-8588-cda60416a2a5')
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,106 @@
-- IDEMPIERE-5259 New window Label Assignment
SELECT register_migration_script('202206241449_IDEMPIERE-5259.sql') FROM dual;
-- Jun 24, 2022, 2:49:05 PM BRT
INSERT INTO AD_Window (AD_Window_ID,Name,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,WindowType,Processing,EntityType,IsSOTrx,IsDefault,WinHeight,WinWidth,IsBetaFunctionality,AD_Window_UU) VALUES (200130,'Label Assignment',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:49:05','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:49:05','YYYY-MM-DD HH24:MI:SS'),10,'M','N','D','N','N',0,0,'N','592aed77-8bce-4903-8b77-ad839869a525')
;
-- Jun 24, 2022, 2:50:25 PM BRT
INSERT INTO AD_Tab (AD_Tab_ID,Name,AD_Window_ID,SeqNo,IsSingleRow,AD_Table_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,HasTree,IsInfoTab,IsTranslationTab,IsReadOnly,Processing,ImportFields,TabLevel,IsSortTab,EntityType,IsInsertRecord,IsAdvancedTab,AD_Tab_UU,TreeDisplayedOn,IsLookupOnlySelection,IsAllowAdvancedLookup,MaxQueryRecords) VALUES (200324,'Assignment',200130,10,'Y',200347,0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:25','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:25','YYYY-MM-DD HH24:MI:SS'),10,'N','N','N','N','N','N',0,'N','D','Y','N','379bc7ea-82fb-4be7-867e-17706d30d156','B','N','Y',0)
;
-- Jun 24, 2022, 2:50:38 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207100,'Tenant','Tenant for this installation.','A Tenant is a company or a legal entity. You cannot share data between Tenants.',200324,214893,'Y',22,10,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','358c70ff-aec5-4677-aacb-9e335675d5b6','Y',10,2)
;
-- Jun 24, 2022, 2:50:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsAllowCopy,IsDisplayedGrid,XPosition,ColumnSpan) VALUES (207101,'Organization','Organizational entity within tenant','An organization is a unit of your tenant or legal entity - examples are store, department. You can share data between organizations.',200324,214894,'Y',22,20,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:38','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','25b2fc93-0c1e-4110-a073-bb41f9557aaa','Y','N',4,2)
;
-- Jun 24, 2022, 2:50:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207102,'Description','Optional short description of the record','A description is limited to 255 characters.',200324,214900,'Y',255,30,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','1ddb9684-ad07-42d8-a636-fb79088e7463','Y',20,5)
;
-- Jun 24, 2022, 2:50:40 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,ColumnSpan) VALUES (207103,'Label Assignment',200324,214891,'N',22,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:39','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','b017a1fb-6746-490d-bac0-bbb27e927cae','N',2)
;
-- Jun 24, 2022, 2:50:40 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207104,'Label Assignment',200324,214892,'Y',36,40,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','28742ba6-5278-4575-8511-2e0ad1ed68d5','Y',30,2)
;
-- Jun 24, 2022, 2:50:41 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207105,'Label','Record Label',200324,214901,'Y',22,50,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:40','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','8cdcaee7-69df-470b-80d0-6ee4ef9a2b5f','Y',40,2)
;
-- Jun 24, 2022, 2:50:41 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207106,'Table','Database Table information','The Database Table provides the information of the table definition',200324,214902,'Y',10,60,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','b6395b2e-fbeb-4f6c-ab4d-fb8215386427','Y',50,2)
;
-- Jun 24, 2022, 2:50:42 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,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) VALUES (207107,'Record ID','Direct internal record ID','The Record ID is the internal unique identifier of a record. Please note that zooming to the record may not be successful for Orders, Invoices and Shipment/Receipts as sometimes the Sales Order type is not known.',200324,214903,'Y',22,70,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:41','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','4d74432a-d903-4c46-86bb-816d904836e5','Y',60,2,2)
;
-- Jun 24, 2022, 2:50:42 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,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) VALUES (207108,'Active','The record is active in the system','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.',200324,214899,'Y',1,80,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-06-24 14:50:42','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:50:42','YYYY-MM-DD HH24:MI:SS'),10,'N','Y','D','03e15bd2-379c-4cc7-a1c8-62e9fcac125d','Y',70,2,2)
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=40, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207108
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET IsDisplayed='N', SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207104
;
-- Jun 24, 2022, 2:54:33 PM BRT
UPDATE AD_Field SET SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 14:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207103
;
-- Jun 24, 2022, 2:55:00 PM BRT
UPDATE AD_Table SET AD_Window_ID=200130,Updated=TO_TIMESTAMP('2022-06-24 14:55:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Table_ID=200347
;
-- Jun 24, 2022, 2:55:52 PM BRT
INSERT INTO AD_Menu (AD_Menu_ID,Name,"action",AD_Window_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,AD_Menu_UU) VALUES (200208,'Label Assignment','W',200130,0,0,'Y',TO_TIMESTAMP('2022-06-24 14:55:51','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2022-06-24 14:55:51','YYYY-MM-DD HH24:MI:SS'),10,'N','N','N','D','Y','0e5d5883-2839-46c8-993a-24ea51a20b61')
;
-- Jun 24, 2022, 2:55:52 PM BRT
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(), 10, statement_timestamp(), 10,t.AD_Tree_ID, 200208, 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=200208)
;
-- Jun 24, 2022, 2:56:08 PM BRT
UPDATE AD_TreeNodeMM SET Parent_ID=153, SeqNo=37,Updated=TO_TIMESTAMP('2022-06-24 14:56:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Tree_ID=10 AND Node_ID=200208
;
-- Jun 24, 2022, 2:56:08 PM BRT
UPDATE AD_TreeNodeMM SET Parent_ID=153, SeqNo=38,Updated=TO_TIMESTAMP('2022-06-24 14:56:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Tree_ID=10 AND Node_ID=50001
;
-- Jun 24, 2022, 2:59:40 PM BRT
UPDATE AD_Column SET IsToolbarButton='N',Updated=TO_TIMESTAMP('2022-06-24 14:59:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214903
;
-- Jun 24, 2022, 3:00:20 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=5, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-06-24 15:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Field_ID=207107
;
-- Jun 24, 2022, 3:02:56 PM BRT
UPDATE AD_Column SET IsSelectionColumn='Y', SeqNoSelection=20,Updated=TO_TIMESTAMP('2022-06-24 15:02:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214902
;
-- Jun 24, 2022, 3:03:08 PM BRT
UPDATE AD_Column SET IsSelectionColumn='Y', SeqNoSelection=30,Updated=TO_TIMESTAMP('2022-06-24 15:03:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214901
;
-- Jun 24, 2022, 3:05:58 PM BRT
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2022-06-24 15:05:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214900
;
-- Jun 24, 2022, 3:10:01 PM BRT
UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2022-06-24 15:10:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=214901
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-5259 Default SysConfig
SELECT register_migration_script('202206291714_IDEMPIERE-5259.sql') FROM dual;
-- Jun 29, 2022, 5:14:48 PM BRT
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 (200201,0,0,TO_TIMESTAMP('2022-06-29 17:14:46','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2022-06-29 17:14:46','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','LABEL_AUTOMATIC_COLOR','Y','Y/N - Define if the application will automatically colorize labels, even if not assigned to a CSS style','D','C','10c6845f-9ce8-4ad7-8588-cda60416a2a5')
;

View File

@ -2202,8 +2202,19 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
return 0;
int recordID = m_mTable.getKeyID(m_currentRow);
return MPostIt.getID(m_vo.AD_Table_ID, recordID);
} // getAD_PostIt_ID
} // getAD_PostIt_ID
/**
* Returns true, if current row has Label(s)
* @return true if record has Label(s)
*/
public boolean hasLabel()
{
if (!canHaveAttachment())
return false;
int recordID = m_mTable.getKeyID(m_currentRow);
return MLabelAssignment.hasAnyAssignment(m_vo.AD_Table_ID, recordID);
} // hasLabel
/**
* Returns true, if this tab have templates allowed with current role

View File

@ -0,0 +1,191 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_Label
* @author iDempiere (generated)
* @version Release 10
*/
public interface I_AD_Label
{
/** TableName=AD_Label */
public static final String Table_Name = "AD_Label";
/** AD_Table_ID=200345 */
public static final int Table_ID = 200345;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 6 - System - Client
*/
BigDecimal accessLevel = BigDecimal.valueOf(6);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_LabelCategory_ID */
public static final String COLUMNNAME_AD_LabelCategory_ID = "AD_LabelCategory_ID";
/** Set Label Category.
* Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID);
/** Get Label Category.
* Category of a Label
*/
public int getAD_LabelCategory_ID();
public org.compiere.model.I_AD_LabelCategory getAD_LabelCategory() throws RuntimeException;
/** Column name AD_Label_ID */
public static final String COLUMNNAME_AD_Label_ID = "AD_Label_ID";
/** Set Label.
* Record Label
*/
public void setAD_Label_ID (int AD_Label_ID);
/** Get Label.
* Record Label
*/
public int getAD_Label_ID();
/** Column name AD_LabelStyle_ID */
public static final String COLUMNNAME_AD_LabelStyle_ID = "AD_LabelStyle_ID";
/** Set Label Style.
* Label CSS Style
*/
public void setAD_LabelStyle_ID (int AD_LabelStyle_ID);
/** Get Label Style.
* Label CSS Style
*/
public int getAD_LabelStyle_ID();
public org.compiere.model.I_AD_Style getAD_LabelStyle() throws RuntimeException;
/** Column name AD_Label_UU */
public static final String COLUMNNAME_AD_Label_UU = "AD_Label_UU";
/** Set Label.
* Record Label
*/
public void setAD_Label_UU (String AD_Label_UU);
/** Get Label.
* Record Label
*/
public String getAD_Label_UU();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within tenant
*/
public int getAD_Org_ID();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Name.
* Alphanumeric identifier of the entity
*/
public void setName (String Name);
/** Get Name.
* Alphanumeric identifier of the entity
*/
public String getName();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,183 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_LabelAssignment
* @author iDempiere (generated)
* @version Release 10
*/
public interface I_AD_LabelAssignment
{
/** TableName=AD_LabelAssignment */
public static final String Table_Name = "AD_LabelAssignment";
/** AD_Table_ID=200347 */
public static final int Table_ID = 200347;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 6 - System - Client
*/
BigDecimal accessLevel = BigDecimal.valueOf(6);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_LabelAssignment_ID */
public static final String COLUMNNAME_AD_LabelAssignment_ID = "AD_LabelAssignment_ID";
/** Set Label Assignment */
public void setAD_LabelAssignment_ID (int AD_LabelAssignment_ID);
/** Get Label Assignment */
public int getAD_LabelAssignment_ID();
/** Column name AD_LabelAssignment_UU */
public static final String COLUMNNAME_AD_LabelAssignment_UU = "AD_LabelAssignment_UU";
/** Set Label Assignment */
public void setAD_LabelAssignment_UU (String AD_LabelAssignment_UU);
/** Get Label Assignment */
public String getAD_LabelAssignment_UU();
/** Column name AD_Label_ID */
public static final String COLUMNNAME_AD_Label_ID = "AD_Label_ID";
/** Set Label.
* Record Label
*/
public void setAD_Label_ID (int AD_Label_ID);
/** Get Label.
* Record Label
*/
public int getAD_Label_ID();
public org.compiere.model.I_AD_Label getAD_Label() throws RuntimeException;
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within tenant
*/
public int getAD_Org_ID();
/** Column name AD_Table_ID */
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
/** Set Table.
* Database Table information
*/
public void setAD_Table_ID (int AD_Table_ID);
/** Get Table.
* Database Table information
*/
public int getAD_Table_ID();
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name Record_ID */
public static final String COLUMNNAME_Record_ID = "Record_ID";
/** Set Record ID.
* Direct internal record ID
*/
public void setRecord_ID (int Record_ID);
/** Get Record ID.
* Direct internal record ID
*/
public int getRecord_ID();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,185 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_LabelCategory
* @author iDempiere (generated)
* @version Release 10
*/
public interface I_AD_LabelCategory
{
/** TableName=AD_LabelCategory */
public static final String Table_Name = "AD_LabelCategory";
/** AD_Table_ID=200343 */
public static final int Table_ID = 200343;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 6 - System - Client
*/
BigDecimal accessLevel = BigDecimal.valueOf(6);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_LabelCategory_ID */
public static final String COLUMNNAME_AD_LabelCategory_ID = "AD_LabelCategory_ID";
/** Set Label Category.
* Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID);
/** Get Label Category.
* Category of a Label
*/
public int getAD_LabelCategory_ID();
/** Column name AD_LabelCategory_UU */
public static final String COLUMNNAME_AD_LabelCategory_UU = "AD_LabelCategory_UU";
/** Set Label Category.
* Category of a Label
*/
public void setAD_LabelCategory_UU (String AD_LabelCategory_UU);
/** Get Label Category.
* Category of a Label
*/
public String getAD_LabelCategory_UU();
/** Column name AD_LabelStyle_ID */
public static final String COLUMNNAME_AD_LabelStyle_ID = "AD_LabelStyle_ID";
/** Set Label Style.
* Label CSS Style
*/
public void setAD_LabelStyle_ID (int AD_LabelStyle_ID);
/** Get Label Style.
* Label CSS Style
*/
public int getAD_LabelStyle_ID();
public org.compiere.model.I_AD_Style getAD_LabelStyle() throws RuntimeException;
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within tenant
*/
public int getAD_Org_ID();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsCanBeUsedInAllTables */
public static final String COLUMNNAME_IsCanBeUsedInAllTables = "IsCanBeUsedInAllTables";
/** Set Can Be Used in All Tables */
public void setIsCanBeUsedInAllTables (boolean IsCanBeUsedInAllTables);
/** Get Can Be Used in All Tables */
public boolean isCanBeUsedInAllTables();
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Name.
* Alphanumeric identifier of the entity
*/
public void setName (String Name);
/** Get Name.
* Alphanumeric identifier of the entity
*/
public String getName();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,170 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_LabelCategoryTable
* @author iDempiere (generated)
* @version Release 10
*/
public interface I_AD_LabelCategoryTable
{
/** TableName=AD_LabelCategoryTable */
public static final String Table_Name = "AD_LabelCategoryTable";
/** AD_Table_ID=200348 */
public static final int Table_ID = 200348;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 6 - System - Client
*/
BigDecimal accessLevel = BigDecimal.valueOf(6);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_LabelCategory_ID */
public static final String COLUMNNAME_AD_LabelCategory_ID = "AD_LabelCategory_ID";
/** Set Label Category.
* Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID);
/** Get Label Category.
* Category of a Label
*/
public int getAD_LabelCategory_ID();
public org.compiere.model.I_AD_LabelCategory getAD_LabelCategory() throws RuntimeException;
/** Column name AD_LabelCategoryTable_ID */
public static final String COLUMNNAME_AD_LabelCategoryTable_ID = "AD_LabelCategoryTable_ID";
/** Set Label Category Table Access */
public void setAD_LabelCategoryTable_ID (int AD_LabelCategoryTable_ID);
/** Get Label Category Table Access */
public int getAD_LabelCategoryTable_ID();
/** Column name AD_LabelCategoryTable_UU */
public static final String COLUMNNAME_AD_LabelCategoryTable_UU = "AD_LabelCategoryTable_UU";
/** Set Label Category Table Access */
public void setAD_LabelCategoryTable_UU (String AD_LabelCategoryTable_UU);
/** Get Label Category Table Access */
public String getAD_LabelCategoryTable_UU();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within tenant
*/
public int getAD_Org_ID();
/** Column name AD_Table_ID */
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
/** Set Table.
* Database Table information
*/
public void setAD_Table_ID (int AD_Table_ID);
/** Get Table.
* Database Table information
*/
public int getAD_Table_ID();
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,163 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import java.util.UUID;
import org.compiere.util.Env;
/**
* Label Model
*/
public class MLabel extends X_AD_Label {
private static final long serialVersionUID = -964945898771768568L;
private static final String[] VIVID_COLORS = {
"#FFB300",
"#FF6800",
"#A6BDD7",
"#CEA262",
"#007D34",
"#F6768E",
"#00538A",
"#FF7A5C",
"#53377A",
"#FF8E00",
"#B32851",
"#F4C800",
"#93AA00",
"#F13A13",
"#1EABAF",
"#3178C1",
"#B83140",
"#0C1326",
"#C71BEF",
"#4600AE",
"#21AA1F",
"#1238C1",
"#0C8077",
"#3F5CE3",
"#1A5300",
"#0CA452",
"#A77A42",
"#293C8D",
"#F8155D",
"#49C600",
"#803120",
"#8C0D22"
};
/**
* Standard Constructor
* @param ctx context
* @param AD_Label_ID id
* @param trxName transaction
*/
public MLabel(Properties ctx, int AD_Label_ID, String trxName) {
super(ctx, AD_Label_ID, trxName);
}
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MLabel(Properties ctx, ResultSet rs, String trxName) {
super(ctx, rs, trxName);
}
/**
* Calculates the label css style based on priorities:
* 1- Label style;
* 2- Category style;
* 3- Label Hash to Hex
* @return css style
*/
public String buildStyle() {
StringBuilder result = new StringBuilder();
// Calculated hex color
if (MSysConfig.getBooleanValue(MSysConfig.LABEL_AUTOMATIC_COLOR, true, getAD_Client_ID())) {
result.append("color: ").append(MLabel.calculateHexColor(getName())).append(";");
}
// Category style
if (getAD_LabelCategory() != null && getAD_LabelCategory().getAD_LabelStyle_ID() > 0)
result.append(buildStyle(getAD_LabelCategory().getAD_LabelStyle_ID()));
// Label style
if (getAD_LabelStyle_ID() > 0)
result.append(buildStyle(getAD_LabelStyle_ID()));
return result.toString();
}
private String buildStyle(int AD_Style_ID) {
StringBuilder result = new StringBuilder();
if (AD_Style_ID > 0) {
MStyle style = new MStyle(getCtx(), AD_Style_ID, get_TrxName());
MStyleLine[] lines = style.getStyleLines();
for (MStyleLine line : lines)
{
String inlineStyle = line.getInlineStyle().trim();
if (result.length() > 0 && !(result.charAt(result.length()-1)==';'))
result.append("; ");
result.append(inlineStyle);
}
result.append(";");
}
return result.toString();
}
/**
* Calculates a color for a given text
* @param text
* @return hex color
*/
public static String calculateHexColor(String text) {
int colorIndex = Math.abs(UUID.nameUUIDFromBytes(text.getBytes()).toString().hashCode() % VIVID_COLORS.length);
return VIVID_COLORS[colorIndex];
}
public static MLabel getByName(Properties ctx, String name, String trxName) {
String sqlWhere = " AD_Client_ID=? AND UPPER(Name) LIKE ?";
return new Query(ctx, Table_Name, sqlWhere, trxName)
.setParameters(Env.getAD_Client_ID(ctx), name.toUpperCase())
.setOnlyActiveRecords(true)
.setOrderBy("Name")
.first();
}
}

View File

@ -0,0 +1,84 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.util.DB;
/**
* Label Assignment Model
*/
public class MLabelAssignment extends X_AD_LabelAssignment {
private static final long serialVersionUID = -964945898771768568L;
/**
* Standard Constructor
* @param ctx context
* @param AD_LabelAssignment_ID id
* @param trxName transaction
*/
public MLabelAssignment(Properties ctx, int AD_LabelAssignment_ID, String trxName) {
super(ctx, AD_LabelAssignment_ID, trxName);
}
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MLabelAssignment(Properties ctx, ResultSet rs, String trxName) {
super(ctx, rs, trxName);
}
/**
* Check if record has any label assigned
* @param Table_ID
* @param Record_ID
* @return true if record has any label assigned
*/
public static boolean hasAnyAssignment(int Table_ID, int Record_ID) {
String sql="SELECT COUNT(*) FROM AD_LabelAssignment WHERE AD_Table_ID=? AND Record_ID=?";
int counter = DB.getSQLValueEx(null, sql, Table_ID, Record_ID);
return counter > 0;
}
/**
* Check if a label is assigned to a record
* @param AD_Label_ID
* @param Table_ID
* @param Record_ID
* @return true if label is assigned
*/
public static boolean hasLabelAssignment(int AD_Label_ID, int Table_ID, int Record_ID) {
String sql="SELECT COUNT(*) FROM AD_LabelAssignment WHERE AD_Label_ID = ? AND AD_Table_ID=? AND Record_ID=?";
int counter = DB.getSQLValueEx(null, sql, AD_Label_ID, Table_ID, Record_ID);
return counter > 0;
}
}

View File

@ -0,0 +1,147 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import org.compiere.util.CCache;
import org.compiere.util.Env;
import org.idempiere.cache.ImmutableIntPOCache;
import org.idempiere.cache.ImmutablePOSupport;
/**
* Label Category Model
*/
public class MLabelCategory extends X_AD_LabelCategory implements ImmutablePOSupport {
private static final long serialVersionUID = 1413261690113516220L;
/** Cache */
private static ImmutableIntPOCache<Integer, MLabelCategory> s_cache = new ImmutableIntPOCache<Integer,MLabelCategory>(Table_Name, 5);
/** Cache of Client */
private static CCache<Integer,MLabelCategory[]> s_cacheAll = new CCache<Integer,MLabelCategory[]>(Table_Name, Table_Name+"_Of_Client", 5);
/**
* Standard Constructor
* @param ctx context
* @param AD_LabelCategory_ID id
* @param trxName transaction
*/
public MLabelCategory(Properties ctx, int AD_LabelCategory_ID, String trxName) {
super(ctx, AD_LabelCategory_ID, trxName);
}
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MLabelCategory(Properties ctx, ResultSet rs, String trxName) {
super(ctx, rs, trxName);
}
/**
* Get All Label Categories (for System and current Client)
* @param ctx context
* @return MLabelCategory array
*/
public static MLabelCategory[] getAll(Properties ctx)
{
int clientID = Env.getAD_Client_ID(ctx);
MLabelCategory[] retValue = (MLabelCategory[])s_cacheAll.get(clientID);
if (retValue != null)
{
if (ctx == Env.getCtx())
return retValue;
else
return Arrays.stream(retValue).map(e -> {return new MLabelCategory(ctx, e).markImmutable();}).toArray(MLabelCategory[]::new);
}
List<MLabelCategory> list = new Query(ctx, Table_Name, "AD_Client_ID IN (0, ?)", null)
.setParameters(clientID)
.setOrderBy("AD_Client_ID DESC, AD_LabelCategory_ID")
.setOnlyActiveRecords(true)
.list();
for (MLabelCategory cat : list)
s_cache.put(cat.get_ID(), cat, e -> new MLabelCategory(Env.getCtx(), e));
retValue = list.toArray(new MLabelCategory[list.size()]);
if (ctx == Env.getCtx())
s_cacheAll.put(clientID, retValue);
else
s_cacheAll.put(clientID, Arrays.stream(retValue).map(e -> {return new MLabelCategory(Env.getCtx(), e);}).toArray(MLabelCategory[]::new));
return retValue;
}
/**
* Load Constructor
* @param copy
*/
public MLabelCategory(MLabelCategory copy)
{
this(Env.getCtx(), copy);
}
/**
* Load Constructor
* @param ctx
* @param copy
*/
public MLabelCategory(Properties ctx, MLabelCategory copy)
{
this(ctx, copy, (String) null);
}
/**
* Load Constructor
* @param ctx
* @param copy
* @param trxName
*/
public MLabelCategory(Properties ctx, MLabelCategory copy, String trxName)
{
this(ctx, 0, trxName);
copyPO(copy);
}
@Override
public MLabelCategory markImmutable() {
if (is_Immutable())
return this;
makeImmutable();
return this;
}
} // MLabelCategory

View File

@ -0,0 +1,58 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/**
* Label Category Table Model
*/
public class MLabelCategoryTable extends X_AD_LabelCategoryTable {
private static final long serialVersionUID = -964945828771768568L;
/**
* Standard Constructor
* @param ctx context
* @param AD_LabelCategoryTable_ID id
* @param trxName transaction
*/
public MLabelCategoryTable(Properties ctx, int AD_LabelCategoryTable_ID, String trxName) {
super(ctx, AD_LabelCategoryTable_ID, trxName);
}
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MLabelCategoryTable(Properties ctx, ResultSet rs, String trxName) {
super(ctx, rs, trxName);
}
}

View File

@ -112,6 +112,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE = "INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE";
public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber";
public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES";
public static final String LABEL_AUTOMATIC_COLOR = "LABEL_AUTOMATIC_COLOR";
public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT";
public static final String LDAP_TYPE = "LDAP_TYPE";
public static final String LOCATION_MAPS_DESTINATION_ADDRESS = "LOCATION_MAPS_DESTINATION_ADDRESS";

View File

@ -56,7 +56,8 @@ public class PO_Record
X_AD_Archive.Table_ID,
X_AD_Note.Table_ID,
X_AD_RecentItem.Table_ID,
X_AD_PostIt.Table_ID
X_AD_PostIt.Table_ID,
X_AD_LabelAssignment.Table_ID
};
/** Cascade Table Names */
private static String[] s_cascadeNames = new String[]{
@ -64,7 +65,8 @@ public class PO_Record
X_AD_Archive.Table_Name,
X_AD_Note.Table_Name,
X_AD_RecentItem.Table_Name,
X_AD_PostIt.Table_Name
X_AD_PostIt.Table_Name,
X_AD_LabelAssignment.Table_Name
};
/** Restrict Table ID */

View File

@ -0,0 +1,208 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/** Generated Model for AD_Label
* @author iDempiere (generated)
* @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="AD_Label")
public class X_AD_Label extends PO implements I_AD_Label, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20220525L;
/** Standard Constructor */
public X_AD_Label (Properties ctx, int AD_Label_ID, String trxName)
{
super (ctx, AD_Label_ID, trxName);
/** if (AD_Label_ID == 0)
{
setName (null);
} */
}
/** Standard Constructor */
public X_AD_Label (Properties ctx, int AD_Label_ID, String trxName, String ... virtualColumns)
{
super (ctx, AD_Label_ID, trxName, virtualColumns);
/** if (AD_Label_ID == 0)
{
setName (null);
} */
}
/** Load Constructor */
public X_AD_Label (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 6 - System - Client
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuilder sb = new StringBuilder ("X_AD_Label[")
.append(get_ID()).append(",Name=").append(getName()).append("]");
return sb.toString();
}
public org.compiere.model.I_AD_LabelCategory getAD_LabelCategory() throws RuntimeException
{
return (org.compiere.model.I_AD_LabelCategory)MTable.get(getCtx(), org.compiere.model.I_AD_LabelCategory.Table_ID)
.getPO(getAD_LabelCategory_ID(), get_TrxName());
}
/** Set Label Category.
@param AD_LabelCategory_ID Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID)
{
if (AD_LabelCategory_ID < 1)
set_Value (COLUMNNAME_AD_LabelCategory_ID, null);
else
set_Value (COLUMNNAME_AD_LabelCategory_ID, Integer.valueOf(AD_LabelCategory_ID));
}
/** Get Label Category.
@return Category of a Label
*/
public int getAD_LabelCategory_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelCategory_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label.
@param AD_Label_ID Record Label
*/
public void setAD_Label_ID (int AD_Label_ID)
{
if (AD_Label_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Label_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Label_ID, Integer.valueOf(AD_Label_ID));
}
/** Get Label.
@return Record Label
*/
public int getAD_Label_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Label_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_Style getAD_LabelStyle() throws RuntimeException
{
return (org.compiere.model.I_AD_Style)MTable.get(getCtx(), org.compiere.model.I_AD_Style.Table_ID)
.getPO(getAD_LabelStyle_ID(), get_TrxName());
}
/** Set Label Style.
@param AD_LabelStyle_ID Label CSS Style
*/
public void setAD_LabelStyle_ID (int AD_LabelStyle_ID)
{
if (AD_LabelStyle_ID < 1)
set_Value (COLUMNNAME_AD_LabelStyle_ID, null);
else
set_Value (COLUMNNAME_AD_LabelStyle_ID, Integer.valueOf(AD_LabelStyle_ID));
}
/** Get Label Style.
@return Label CSS Style
*/
public int getAD_LabelStyle_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelStyle_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label.
@param AD_Label_UU Record Label
*/
public void setAD_Label_UU (String AD_Label_UU)
{
set_ValueNoCheck (COLUMNNAME_AD_Label_UU, AD_Label_UU);
}
/** Get Label.
@return Record Label
*/
public String getAD_Label_UU()
{
return (String)get_Value(COLUMNNAME_AD_Label_UU);
}
/** Set Description.
@param Description Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Name.
@param Name Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName()
{
return (String)get_Value(COLUMNNAME_Name);
}
}

View File

@ -0,0 +1,216 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/** Generated Model for AD_LabelAssignment
* @author iDempiere (generated)
* @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="AD_LabelAssignment")
public class X_AD_LabelAssignment extends PO implements I_AD_LabelAssignment, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20220525L;
/** Standard Constructor */
public X_AD_LabelAssignment (Properties ctx, int AD_LabelAssignment_ID, String trxName)
{
super (ctx, AD_LabelAssignment_ID, trxName);
/** if (AD_LabelAssignment_ID == 0)
{
setAD_Label_ID (0);
setAD_Table_ID (0);
setRecord_ID (0);
} */
}
/** Standard Constructor */
public X_AD_LabelAssignment (Properties ctx, int AD_LabelAssignment_ID, String trxName, String ... virtualColumns)
{
super (ctx, AD_LabelAssignment_ID, trxName, virtualColumns);
/** if (AD_LabelAssignment_ID == 0)
{
setAD_Label_ID (0);
setAD_Table_ID (0);
setRecord_ID (0);
} */
}
/** Load Constructor */
public X_AD_LabelAssignment (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 6 - System - Client
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuilder sb = new StringBuilder ("X_AD_LabelAssignment[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Label Assignment.
@param AD_LabelAssignment_ID Label Assignment
*/
public void setAD_LabelAssignment_ID (int AD_LabelAssignment_ID)
{
if (AD_LabelAssignment_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_LabelAssignment_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_LabelAssignment_ID, Integer.valueOf(AD_LabelAssignment_ID));
}
/** Get Label Assignment.
@return Label Assignment */
public int getAD_LabelAssignment_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelAssignment_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label Assignment.
@param AD_LabelAssignment_UU Label Assignment
*/
public void setAD_LabelAssignment_UU (String AD_LabelAssignment_UU)
{
set_ValueNoCheck (COLUMNNAME_AD_LabelAssignment_UU, AD_LabelAssignment_UU);
}
/** Get Label Assignment.
@return Label Assignment */
public String getAD_LabelAssignment_UU()
{
return (String)get_Value(COLUMNNAME_AD_LabelAssignment_UU);
}
public org.compiere.model.I_AD_Label getAD_Label() throws RuntimeException
{
return (org.compiere.model.I_AD_Label)MTable.get(getCtx(), org.compiere.model.I_AD_Label.Table_ID)
.getPO(getAD_Label_ID(), get_TrxName());
}
/** Set Label.
@param AD_Label_ID Record Label
*/
public void setAD_Label_ID (int AD_Label_ID)
{
if (AD_Label_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Label_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Label_ID, Integer.valueOf(AD_Label_ID));
}
/** Get Label.
@return Record Label
*/
public int getAD_Label_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Label_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
{
return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_ID)
.getPO(getAD_Table_ID(), get_TrxName());
}
/** Set Table.
@param AD_Table_ID Database Table information
*/
public void setAD_Table_ID (int AD_Table_ID)
{
if (AD_Table_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Table_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Table_ID, Integer.valueOf(AD_Table_ID));
}
/** Get Table.
@return Database Table information
*/
public int getAD_Table_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Table_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Record ID.
@param Record_ID Direct internal record ID
*/
public void setRecord_ID (int Record_ID)
{
if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Integer.valueOf(Record_ID));
}
/** Get Record ID.
@return Direct internal record ID
*/
public int getRecord_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}

View File

@ -0,0 +1,202 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/** Generated Model for AD_LabelCategory
* @author iDempiere (generated)
* @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="AD_LabelCategory")
public class X_AD_LabelCategory extends PO implements I_AD_LabelCategory, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20220525L;
/** Standard Constructor */
public X_AD_LabelCategory (Properties ctx, int AD_LabelCategory_ID, String trxName)
{
super (ctx, AD_LabelCategory_ID, trxName);
/** if (AD_LabelCategory_ID == 0)
{
setName (null);
} */
}
/** Standard Constructor */
public X_AD_LabelCategory (Properties ctx, int AD_LabelCategory_ID, String trxName, String ... virtualColumns)
{
super (ctx, AD_LabelCategory_ID, trxName, virtualColumns);
/** if (AD_LabelCategory_ID == 0)
{
setName (null);
} */
}
/** Load Constructor */
public X_AD_LabelCategory (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 6 - System - Client
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuilder sb = new StringBuilder ("X_AD_LabelCategory[")
.append(get_ID()).append(",Name=").append(getName()).append("]");
return sb.toString();
}
/** Set Label Category.
@param AD_LabelCategory_ID Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID)
{
if (AD_LabelCategory_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_LabelCategory_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_LabelCategory_ID, Integer.valueOf(AD_LabelCategory_ID));
}
/** Get Label Category.
@return Category of a Label
*/
public int getAD_LabelCategory_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelCategory_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label Category.
@param AD_LabelCategory_UU Category of a Label
*/
public void setAD_LabelCategory_UU (String AD_LabelCategory_UU)
{
set_ValueNoCheck (COLUMNNAME_AD_LabelCategory_UU, AD_LabelCategory_UU);
}
/** Get Label Category.
@return Category of a Label
*/
public String getAD_LabelCategory_UU()
{
return (String)get_Value(COLUMNNAME_AD_LabelCategory_UU);
}
public org.compiere.model.I_AD_Style getAD_LabelStyle() throws RuntimeException
{
return (org.compiere.model.I_AD_Style)MTable.get(getCtx(), org.compiere.model.I_AD_Style.Table_ID)
.getPO(getAD_LabelStyle_ID(), get_TrxName());
}
/** Set Label Style.
@param AD_LabelStyle_ID Label CSS Style
*/
public void setAD_LabelStyle_ID (int AD_LabelStyle_ID)
{
if (AD_LabelStyle_ID < 1)
set_Value (COLUMNNAME_AD_LabelStyle_ID, null);
else
set_Value (COLUMNNAME_AD_LabelStyle_ID, Integer.valueOf(AD_LabelStyle_ID));
}
/** Get Label Style.
@return Label CSS Style
*/
public int getAD_LabelStyle_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelStyle_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Can Be Used in All Tables.
@param IsCanBeUsedInAllTables Can Be Used in All Tables
*/
public void setIsCanBeUsedInAllTables (boolean IsCanBeUsedInAllTables)
{
set_Value (COLUMNNAME_IsCanBeUsedInAllTables, Boolean.valueOf(IsCanBeUsedInAllTables));
}
/** Get Can Be Used in All Tables.
@return Can Be Used in All Tables */
public boolean isCanBeUsedInAllTables()
{
Object oo = get_Value(COLUMNNAME_IsCanBeUsedInAllTables);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName()
{
return (String)get_Value(COLUMNNAME_Name);
}
}

View File

@ -0,0 +1,192 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/** Generated Model for AD_LabelCategoryTable
* @author iDempiere (generated)
* @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="AD_LabelCategoryTable")
public class X_AD_LabelCategoryTable extends PO implements I_AD_LabelCategoryTable, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20220525L;
/** Standard Constructor */
public X_AD_LabelCategoryTable (Properties ctx, int AD_LabelCategoryTable_ID, String trxName)
{
super (ctx, AD_LabelCategoryTable_ID, trxName);
/** if (AD_LabelCategoryTable_ID == 0)
{
setAD_LabelCategory_ID (0);
setAD_Table_ID (0);
} */
}
/** Standard Constructor */
public X_AD_LabelCategoryTable (Properties ctx, int AD_LabelCategoryTable_ID, String trxName, String ... virtualColumns)
{
super (ctx, AD_LabelCategoryTable_ID, trxName, virtualColumns);
/** if (AD_LabelCategoryTable_ID == 0)
{
setAD_LabelCategory_ID (0);
setAD_Table_ID (0);
} */
}
/** Load Constructor */
public X_AD_LabelCategoryTable (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 6 - System - Client
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuilder sb = new StringBuilder ("X_AD_LabelCategoryTable[")
.append(get_ID()).append("]");
return sb.toString();
}
public org.compiere.model.I_AD_LabelCategory getAD_LabelCategory() throws RuntimeException
{
return (org.compiere.model.I_AD_LabelCategory)MTable.get(getCtx(), org.compiere.model.I_AD_LabelCategory.Table_ID)
.getPO(getAD_LabelCategory_ID(), get_TrxName());
}
/** Set Label Category.
@param AD_LabelCategory_ID Category of a Label
*/
public void setAD_LabelCategory_ID (int AD_LabelCategory_ID)
{
if (AD_LabelCategory_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_LabelCategory_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_LabelCategory_ID, Integer.valueOf(AD_LabelCategory_ID));
}
/** Get Label Category.
@return Category of a Label
*/
public int getAD_LabelCategory_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelCategory_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label Category Table Access.
@param AD_LabelCategoryTable_ID Label Category Table Access
*/
public void setAD_LabelCategoryTable_ID (int AD_LabelCategoryTable_ID)
{
if (AD_LabelCategoryTable_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_LabelCategoryTable_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_LabelCategoryTable_ID, Integer.valueOf(AD_LabelCategoryTable_ID));
}
/** Get Label Category Table Access.
@return Label Category Table Access */
public int getAD_LabelCategoryTable_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_LabelCategoryTable_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Label Category Table Access.
@param AD_LabelCategoryTable_UU Label Category Table Access
*/
public void setAD_LabelCategoryTable_UU (String AD_LabelCategoryTable_UU)
{
set_ValueNoCheck (COLUMNNAME_AD_LabelCategoryTable_UU, AD_LabelCategoryTable_UU);
}
/** Get Label Category Table Access.
@return Label Category Table Access */
public String getAD_LabelCategoryTable_UU()
{
return (String)get_Value(COLUMNNAME_AD_LabelCategoryTable_UU);
}
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
{
return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_ID)
.getPO(getAD_Table_ID(), get_TrxName());
}
/** Set Table.
@param AD_Table_ID Database Table information
*/
public void setAD_Table_ID (int AD_Table_ID)
{
if (AD_Table_ID < 1)
set_Value (COLUMNNAME_AD_Table_ID, null);
else
set_Value (COLUMNNAME_AD_Table_ID, Integer.valueOf(AD_Table_ID));
}
/** Get Table.
@return Database Table information
*/
public int getAD_Table_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Table_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription()
{
return (String)get_Value(COLUMNNAME_Description);
}
}

View File

@ -124,6 +124,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
private ToolBarButton btnChat;
private ToolBarButton btnPostIt;
private ToolBarButton btnLabel;
private ToolBarButton btnCustomize;
@ -232,6 +234,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnAttachment = createButton("Attachment", "Attachment", "Attachment");
btnPostIt = createButton("PostIt", "PostIt", "PostIt");
btnChat = createButton("Chat", "Chat", "Chat");
btnLabel = createButton("Label", "Label", "Label");
btnGridToggle = createButton("Toggle", "Multi", "Toggle");
btnGridToggle.setTooltiptext(btnGridToggle.getTooltiptext()+ " Alt+T");
btnParentRecord = createButton("ParentRecord", "Parent", "ParentRecord");
@ -735,6 +738,15 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
{
this.btnPostIt.setDisabled(!enabled);
}
/**
* Enable/disable the label button
* @param enabled
*/
public void enableLabel(boolean enabled)
{
this.btnLabel.setDisabled(!enabled);
}
public Event getEvent()
{

View File

@ -83,6 +83,7 @@ import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.CustomizeGridViewDialog;
import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.FindWindow;
import org.adempiere.webui.window.LabelAction;
import org.adempiere.webui.window.WChat;
import org.adempiere.webui.window.WPostIt;
import org.adempiere.webui.window.WRecordAccessDialog;
@ -1135,7 +1136,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
LayoutUtils.openOverlappedWindow(getComponent(), postit, "middle_center");
postit.showWindow();
}
/**
* Open Label panel
*/
public void onLabel() {
toolbar.setPressed("Label",false);
LabelAction labelAction = new LabelAction(this);
labelAction.show();
}
/**
* @see ToolbarListener#onToggle()
*/
@ -1911,11 +1921,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
toolbar.setPressed("Chat",adTabbox.getSelectedGridTab().hasChat());
toolbar.enablePostIt(true);
toolbar.setPressed("PostIt",adTabbox.getSelectedGridTab().hasPostIt());
toolbar.enableLabel(true);
toolbar.setPressed("Label",adTabbox.getSelectedGridTab().hasLabel());
}
else
{
toolbar.enableChat(false);
toolbar.enablePostIt(false);
toolbar.enableLabel(false);
}
// Elaine 2008/12/05

View File

@ -0,0 +1,171 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.adempiere.webui.apps;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.apps.LabelsSearchController.LabelItem;
import org.adempiere.webui.component.Bandbox;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.zk.ui.Page;
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.event.InputEvent;
import org.zkoss.zk.ui.event.KeyEvent;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Bandpopup;
import org.zkoss.zul.Div;
public class LabelsSearch extends Div implements EventListener<Event> {
private static final long serialVersionUID = -8793878697269469837L;
private static final String ON_ENTER_KEY = "onEnterKey";
private static final String ON_CREATE_ECHO = "onCreateEcho";
private static final String ON_SEARCH = "onSearch";
private Bandbox bandbox;
private LabelsSearchController controller;
/**
* Standard constructot
* @param controller
*/
public LabelsSearch(LabelsSearchController controller) {
this.controller = controller;
init();
}
private void init() {
bandbox = new Bandbox();
appendChild(bandbox);
ZKUpdateUtil.setWidth(bandbox, "100%");
bandbox.setAutodrop(true);
bandbox.setId("labelsSearchBox");
bandbox.addEventListener(Events.ON_CHANGING, this);
bandbox.addEventListener(Events.ON_CHANGE, this);
bandbox.setCtrlKeys("#up#down");
bandbox.addEventListener(Events.ON_CTRL_KEY, this);
bandbox.setPlaceholder(Msg.getMsg(Env.getCtx(),"TypeToSearchOrCreate"));
Bandpopup popup = new Bandpopup();
ZKUpdateUtil.setWindowHeightX(popup, 100);
ZKUpdateUtil.setWindowWidthX(popup, 176);
bandbox.appendChild(popup);
controller.create(popup);
addEventListener(ON_SEARCH, this);
addEventListener(ON_CREATE_ECHO, this);
addEventListener(LabelsSearchController.ON_POST_SELECT_LABELITEM_EVENT, this);
bandbox.addEventListener(ON_ENTER_KEY, this);
}
@Override
public void onEvent(Event event) throws Exception {
if (Events.ON_CHANGING.equals(event.getName())) {
InputEvent inputEvent = (InputEvent) event;
String value = inputEvent.getValue();
bandbox.setAttribute("last.onchanging", value);
Events.postEvent(ON_SEARCH, this, value);
} else if (Events.ON_CHANGE.equals(event.getName())) {
bandbox.removeAttribute("last.onchanging");
} else if (Events.ON_CTRL_KEY.equals(event.getName())) {
KeyEvent ke = (KeyEvent) event;
if (ke.getKeyCode() == KeyEvent.UP) {
if (bandbox.getFirstChild().isVisible()) {
LabelItem selected = controller.selectPrior();
if (selected != null) {
bandbox.setText(selected.getLabel());
}
}
} else if (ke.getKeyCode() == KeyEvent.DOWN) {
if (bandbox.getFirstChild().isVisible()) {
LabelItem selected = controller.selectNext();
if (selected != null) {
bandbox.setText(selected.getLabel());
}
}
}
} else if (event.getName().equals(ON_SEARCH)) {
String value = (String) event.getData();
controller.search(value);
bandbox.focus();
} else if (event.getName().equals(ON_CREATE_ECHO)) {
StringBuilder script = new StringBuilder("jq('#")
.append(bandbox.getUuid())
.append("').bind('keydown', function(e) {var code=e.keyCode||e.which;if(code==13){")
.append("var widget=zk.Widget.$(this);")
.append("var event=new zk.Event(widget,'")
.append(ON_ENTER_KEY)
.append("',{},{toServer:true});")
.append("zAu.send(event);")
.append("}});");
Clients.evalJavaScript(script.toString());
} else if (event.getName().equals(ON_ENTER_KEY)) {
if (event.getTarget() instanceof Bandbox) {
controller.onSelect(controller.getSelectedItem());
}
} else if (event.getName().equals(Events.ON_SELECT)) {
String value = (String) bandbox.getAttribute("last.onchanging");
if (value == null) {
value = bandbox.getValue();
}
Events.postEvent(ON_SEARCH, this, value);
}
if (event.getName().equals(LabelsSearchController.ON_POST_SELECT_LABELITEM_EVENT)) {
closePopup();
bandbox.focus();
bandbox.setText(null);
bandbox.setValue(null);
}
}
@Override
public void onPageAttached(Page newpage, Page oldpage) {
super.onPageAttached(newpage, oldpage);
Events.echoEvent(ON_CREATE_ECHO, this, null);
}
/**
* Close the search dropdown
*/
public void closePopup() {
if (bandbox != null) {
bandbox.close();
}
}
/**
* Set height of the search dropdown
*/
public void onClientInfo() {
ZKUpdateUtil.setWindowHeightX(bandbox.getDropdown(), ClientInfo.get().desktopHeight-50);
}
}

View File

@ -0,0 +1,390 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.adempiere.webui.apps;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.panel.LabelsPanel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.model.MLabel;
import org.compiere.model.MLabelAssignment;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Util;
import org.zkoss.zk.ui.Component;
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.ListModel;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listheader;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import org.zkoss.zul.ListitemRendererExt;
import org.zkoss.zul.Vlayout;
public class LabelsSearchController implements EventListener<Event>{
public static final String ON_POST_SELECT_LABELITEM_EVENT = "onPostSelectLabelitem";
private static final String ON_SEARCH_ECHO = "onSearchEcho";
private static final String ON_LOAD_MORE = "onLoadMore";
private Component parent;
private Listbox listbox;
private ListModelList<LabelItem> model;
private Vlayout layout;
private LabelsPanel labelsPanel;
/**
* Standard constructor
* @param labelsPanel
*/
public LabelsSearchController(LabelsPanel labelsPanel) {
this.labelsPanel = labelsPanel;
}
/**
* Create the controller for the search field
* @param parent
*/
public void create(Component parent) {
this.parent = parent;
layout = new Vlayout();
ZKUpdateUtil.setHeight(layout, "100%");
parent.appendChild(layout);
listbox = new Listbox();
listbox.setItemRenderer(new LabelItemRenderer());
listbox.setStyle("border: none");
ZKUpdateUtil.setWidth(listbox, "100%");
ZKUpdateUtil.setVflex(listbox, "true");
layout.appendChild(listbox);
listbox.addEventListener(Events.ON_SELECT, this);
listbox.addEventListener(ON_POST_SELECT_LABELITEM_EVENT, this);
ListHead listhead = new ListHead();
listbox.appendChild(listhead);
Listheader listheader = new Listheader();
listhead.appendChild(listheader);
listheader = new Listheader();
listheader.setAlign("center");
listheader.setValign("middle");
ZKUpdateUtil.setWidth(listheader, "30px");
listhead.appendChild(listheader);
layout.addEventListener(ON_SEARCH_ECHO, this);
layout.addEventListener(ON_LOAD_MORE, this);
}
@Override
public void onEvent(Event event) throws Exception {
if (event.getName().equals(ON_SEARCH_ECHO)) {
onSearchEcho((String) event.getData());
} else if (Events.ON_CLICK.equals(event.getName())) {
if (event.getTarget() instanceof ListItem) {
ListItem item = (ListItem) event.getTarget();
LabelItem labelItem = item.getValue();
onSelect(labelItem);
}
}
}
/**
* Search for a given text
* @param value
*/
public void search(String value) {
listbox.setModel((ListModel<?>)null);
Events.echoEvent(ON_SEARCH_ECHO, layout, value);
}
/**
* Search for a given text
* @param value
*/
public void onSearchEcho(String value) {
ListModelList<LabelItem> newModel = null;
if (Util.isEmpty(value)) {
newModel = model;
} else {
newModel = new ListModelList<LabelItem>();
boolean found = false;
int currentIndex = 0;
int foundIndex = 0;
String sql = "SELECT"
+ " AD_Label.AD_Label_ID,"
+ " AD_Label.Name,"
+ " COUNT(AD_LabelAssignment.*),"
+ " CASE "
+ " WHEN AD_Label.AD_LabelCategory_ID > 0 AND AD_LabelCategory.IsCanBeUsedInAllTables = 'N'"
+ " AND AD_LabelCategoryTable.AD_Table_ID <> ? THEN 'N'"
+ " ELSE 'Y'"
+ " END AS IsAllowed"
+ " FROM AD_Label"
+ " LEFT JOIN AD_LabelAssignment ON AD_LabelAssignment.AD_Label_ID = AD_Label.AD_Label_ID"
+ " LEFT JOIN AD_LabelCategory ON AD_LabelCategory.AD_LabelCategory_ID = AD_LabelCategory.AD_LabelCategory_ID"
+ " LEFT JOIN AD_LabelCategoryTable ON AD_LabelCategoryTable.AD_LabelCategory_ID = AD_LabelCategory.AD_LabelCategory_ID"
+ " WHERE AD_Label.AD_Client_ID = ? AND AD_Label.Name ILIKE ?"
+ " GROUP BY AD_Label.AD_Label_ID, AD_Label.Name, IsAllowed"
+ " ORDER BY COUNT(AD_LabelAssignment.*) DESC";
//+ " FETCH FIRST 15 ROWS ONLY";
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, labelsPanel.getAD_Table_ID());
pstmt.setInt(2, Env.getAD_Client_ID(Env.getCtx()));
pstmt.setString(3, "%" + value + "%");
rs = pstmt.executeQuery();
while (rs.next()) {
LabelItem i = new LabelItem(rs.getInt(1), rs.getString(2), rs.getInt(3), rs.getBoolean(4));
newModel.add(i);
if (rs.getString(2).toUpperCase().equals(value.toUpperCase())) {
found = true;
foundIndex = currentIndex;
}
currentIndex++;
}
} catch (SQLException e) {
throw new AdempiereException(e);
} finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
if (!found) {
LabelItem i = new LabelItem(0, value, 0, true);
newModel.add(i);
}
listbox.setModel(newModel);
listbox.setSelectedIndex(foundIndex);
}
}
/**
* Assign the selected label to the record. If doesn't exist, create the label.
* @param item
*/
public void onSelect(LabelItem item) {
if (item == null || !item.isAllowed())
return;
MLabel label = null;
if (item.getC_Label_ID() > 0) {
label = new MLabel(Env.getCtx(), item.getC_Label_ID(), null);
} else {
// Try to find an existing label before creating a new one
label = MLabel.getByName(Env.getCtx(), item.getLabel(), null);
if (label == null) {
label = new MLabel(Env.getCtx(), 0, null);
}
}
if (label.get_ID() <= 0) {
label.setAD_Org_ID(0);
label.setName(item.getLabel());
label.saveEx();
}
// Assign
if (!MLabelAssignment.hasLabelAssignment(label.get_ID(),
labelsPanel.getAD_Table_ID(),
labelsPanel.getRecord_ID())) {
MLabelAssignment assign = new MLabelAssignment(Env.getCtx(), 0, null);
assign.setAD_Org_ID(label.getAD_Org_ID());
assign.setAD_Label_ID(label.get_ID());
assign.setAD_Table_ID(labelsPanel.getAD_Table_ID());
assign.setRecord_ID(labelsPanel.getRecord_ID());
assign.saveEx();
}
Events.echoEvent(ON_POST_SELECT_LABELITEM_EVENT, labelsPanel, item);
Events.echoEvent(ON_POST_SELECT_LABELITEM_EVENT, parent.getParent().getParent(), item);
}
/**
* Get the selected item in the search results
* @return selected label or null
*/
public LabelItem getSelectedItem() {
ListItem selected = listbox.getSelectedItem();
if (selected == null) return null;
return selected.getValue();
}
/**
* Select the previous item in the search results
* @return previous label or null
*/
public LabelItem selectPrior() {
int i = listbox.getSelectedIndex();
if (i > 0) {
listbox.setSelectedIndex(i-1);
ListItem selected = listbox.getSelectedItem();
if (selected == null) return null;
Clients.scrollIntoView(selected);
LabelItem item = selected.getValue();
return item;
}
return null;
}
/**
* Select the next item in the search results
* @return next label or null
*/
public LabelItem selectNext() {
int i = listbox.getSelectedIndex();
if (i < 0 && listbox.getItemCount() > 0) {
listbox.setSelectedIndex(0);
ListItem selected = listbox.getSelectedItem();
if (selected == null) return null;
LabelItem item = selected.getValue();
return item;
} else if (i+1 < listbox.getItemCount()) {
listbox.setSelectedIndex(i+1);
ListItem selected = listbox.getSelectedItem();
if (selected == null) return null;
LabelItem item = selected.getValue();
if (item == null) return null;
Clients.scrollIntoView(selected);
return item;
}
return null;
}
/**
* Search result item
*/
public class LabelItem {
private String label;
private int C_Label_ID;
private int countUsed;
private boolean isAllowed;
public LabelItem(int C_Label_ID, String label, int countUsed, boolean isAllowed) {
this.label = label;
this.C_Label_ID = C_Label_ID;
this.countUsed = countUsed;
this.isAllowed = isAllowed;
}
public String getLabel() {
return label;
}
public int getC_Label_ID() {
return C_Label_ID;
}
public int getCountUsed() {
return countUsed;
}
public boolean isAllowed() {
return isAllowed;
}
}
private class LabelItemRenderer implements ListitemRenderer<LabelItem>, ListitemRendererExt {
@Override
public Listitem newListitem(org.zkoss.zul.Listbox listbox) {
return new ListItem();
}
@Override
public Listcell newListcell(Listitem item) {
return new Listcell(item.getLabel());
}
@Override
public int getControls() {
return ListitemRendererExt.DETACH_ON_RENDER;
}
@Override
public void render(Listitem item, LabelItem data, int index)
throws Exception {
Label labelName = new Label(data.getLabel());
labelName.setStyle("color: " + MLabel.calculateHexColor(data.getLabel()));
Listcell cell = new Listcell();
cell.appendChild(labelName);
if (data.getC_Label_ID() > 0) {
Label labelCountUsed = new Label("(" + data.getCountUsed() + ")");
labelCountUsed.setStyle("color: #909090; margin-left: 4px;");
cell.appendChild(labelCountUsed);
}
if (!data.isAllowed())
item.setDisabled(true);
item.appendChild(cell);
item.setValue(data);
item.addEventListener(Events.ON_CLICK, LabelsSearchController.this);
Listcell cell2 = new Listcell();
if (data.getC_Label_ID() <= 0) {
if (ThemeManager.isUseFontIconForImage())
cell2.setIconSclass("z-icon-New");
else
cell2.setImage(ThemeManager.getThemeResource("images/New16.png"));
} else {
if (!data.isAllowed()) {
if (ThemeManager.isUseFontIconForImage())
cell2.setIconSclass("z-icon-NotAllowed");
else
cell2.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
}
}
item.appendChild(cell2);
}
}
}

View File

@ -0,0 +1,146 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.adempiere.webui.panel;
import java.util.ArrayList;
import java.util.List;
import org.adempiere.webui.adwindow.AbstractADWindowContent;
import org.adempiere.webui.apps.LabelsSearchController;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ZkCssHelper;
import org.compiere.model.MLabel;
import org.compiere.model.MLabelAssignment;
import org.compiere.model.Query;
import org.compiere.util.Env;
import org.zkoss.zk.ui.Component;
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.Div;
import org.zkoss.zul.Groupbox;
public class LabelsPanel extends Div implements EventListener<Event> {
private static final long serialVersionUID = 2232899183255702050L;
private AbstractADWindowContent abstractADWindowContent;
private int AD_Table_ID;
private int Record_ID;
/**
* Standard constructor
* @param abstractADWindowContent
* @param AD_Table_ID
* @param Record_ID
*/
public LabelsPanel(AbstractADWindowContent abstractADWindowContent, int AD_Table_ID, int Record_ID) {
this.abstractADWindowContent = abstractADWindowContent;
this.AD_Table_ID = AD_Table_ID;
this.Record_ID = Record_ID;
setStyle("padding:0px 5px;");
addEventListener(LabelsSearchController.ON_POST_SELECT_LABELITEM_EVENT, this);
update();
}
/**
* Get current table id
* @return id
*/
public int getAD_Table_ID() {
return AD_Table_ID;
}
/**
* Get current record id
* @return
*/
public int getRecord_ID() {
return Record_ID;
}
@Override
public void onEvent(Event event) throws Exception {
if (event.getName().equals(LabelsSearchController.ON_POST_SELECT_LABELITEM_EVENT)) {
update();
}
}
private void update() {
// Clear children
List<Component> children = new ArrayList<Component>(getChildren());
for (Component child : children) {
this.removeChild(child);
}
// Query
List<MLabelAssignment> assignmentsList = new Query(Env.getCtx(),
MLabelAssignment.Table_Name, "AD_Table_ID=? AND Record_ID=?", null)
.setParameters(AD_Table_ID, Record_ID)
.setOrderBy(MLabelAssignment.COLUMNNAME_Created)
.list();
for (MLabelAssignment assignment : assignmentsList) {
Div d = new Div();
ZkCssHelper.appendStyle(d, "float: left;");
LabelPill gb = new LabelPill(assignment);
d.appendChild(gb);
appendChild(d);
}
abstractADWindowContent.getToolbar().setPressed("Label",abstractADWindowContent.getActiveGridTab().hasLabel());
}
private class LabelPill extends Groupbox {
private static final long serialVersionUID = -2248242199670448950L;
public LabelPill(MLabelAssignment assignment) {
setContentStyle("border: none; padding: 0px 4px 6px 4px;");
MLabel label = new MLabel(assignment.getCtx(), assignment.getAD_Label_ID(), assignment.get_TrxName());
Label name = new Label(label.getName());
ZkCssHelper.appendStyle(name, label.buildStyle());
appendChild(name);
Label closeButton = new Label("x");
ZkCssHelper.appendStyle(closeButton,
"cursor: pointer; margin:3px; font-size: 10px; font-weight: bold; color: #909090; vertical-align: super;");
appendChild(closeButton);
closeButton.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (Events.ON_CLICK.equals(event.getName())) {
assignment.deleteEx(true);
LabelsPanel.this.update();
}
}
});
}
}
}

View File

@ -0,0 +1,84 @@
/***********************************************************************
* 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: *
* - Nicolas Micoud (TGI) *
* - Alan Lescano *
* - Norbert Bede *
**********************************************************************/
package org.adempiere.webui.window;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.adwindow.AbstractADWindowContent;
import org.adempiere.webui.apps.LabelsSearch;
import org.adempiere.webui.apps.LabelsSearchController;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.panel.LabelsPanel;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.zkoss.zul.Popup;
import org.zkoss.zul.impl.LabelImageElement;
public class LabelAction {
private AbstractADWindowContent panel;
private Window window = null;
private LabelsPanel labelsPanel;
/**
* Standard constructor
* @param panel
*/
public LabelAction(AbstractADWindowContent panel) {
this.panel = panel;
int AD_Table_ID = panel.getActiveGridTab().getAD_Table_ID();
int Record_ID = panel.getActiveGridTab().getRecord_ID();
labelsPanel = new LabelsPanel(panel, AD_Table_ID, Record_ID);
}
/**
* Open the popup window
*/
public void show() {
if(window == null) {
window = new Window();
ZKUpdateUtil.setWindowWidthX(window, 200);
window.setClosable(true);
window.setBorder("normal");
window.setStyle("position:absolute");
window.addCallback(Window.AFTER_PAGE_DETACHED, t -> panel.focusToLastFocusEditor());
LabelsSearchController controller = new LabelsSearchController(labelsPanel);
LabelsSearch globalSearch = new LabelsSearch(controller);
ZkCssHelper.appendStyle(globalSearch, "display: flex; flex-direction: column; margin: 8px; margin-top: 5px;");
window.appendChild(globalSearch);
window.appendChild(labelsPanel);
}
LabelImageElement toolbarItem = panel.getToolbar().getToolbarItem("Label");
Popup popup = LayoutUtils.findPopup(toolbarItem);
if (popup != null)
popup.appendChild(window);
LayoutUtils.openPopupWindow(toolbarItem, window, "after_start");
window.setFocus(true);
panel.getToolbar().setPressed("Label", panel.getADTab().getSelectedGridTab().hasLabel());
}
}

View File

@ -226,6 +226,12 @@
.z-icon-PostIt:before {
content: "\f24a";
}
.z-icon-Label:before {
content: "\f02b";
}
.z-icon-NotAllowed:before {
content: "\f05e";
}
.z-icon-Preference:before {
content: "\f085";
}