IDEMPIERE-1899 EMail : Implement default mail text and allow images within message / based on patch and idea from Nicolas Micoud (nmicoud)

This commit is contained in:
Carlos Ruiz 2014-05-21 08:17:43 -05:00
parent 8ab4db18d5
commit 4169252fc9
7 changed files with 571 additions and 18 deletions

View File

@ -0,0 +1,219 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 2, 2014 9:15:14 AM CEST
-- IDEMPIERE-1899
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202698,'644f9b63-6ded-406e-abec-44d87375820a',0,'R_DefaultMailText_ID',TO_DATE('2014-05-02 09:15:13','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Default mail template','Default mail template',TO_DATE('2014-05-02 09:15:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:15:31 AM CEST
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202699,'05f5cb33-9346-4d6d-81c0-26c599af9b5a',0,'IsAddMailTextAutomatically',TO_DATE('2014-05-02 09:15:30','YYYY-MM-DD HH24:MI:SS'),100,'The selected mail template will be automatically inserted when creating an email','D','Y','Add Mail Text Automatically','Add Mail Text Automatically',TO_DATE('2014-05-02 09:15:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:15:50 AM CEST
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211208,'9cc67589-fb40-4206-9f03-4057670ed430',202699,0,20,114,'IsAddMailTextAutomatically',TO_DATE('2014-05-02 09:15:49','YYYY-MM-DD HH24:MI:SS'),100,'N','The selected mail template will be automatically inserted when creating an email','D','N',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Add Mail Text Automatically',0,0,TO_DATE('2014-05-02 09:15:49','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- May 2, 2014 9:15:54 AM CEST
ALTER TABLE AD_User ADD IsAddMailTextAutomatically CHAR(1) DEFAULT 'N' CHECK (IsAddMailTextAutomatically IN ('Y','N')) NOT NULL
;
-- May 2, 2014 9:16:15 AM CEST
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211209,'2ecd8ac6-61d1-4062-85d9-2968e5a8f74c',202698,0,18,274,114,'R_DefaultMailText_ID',TO_DATE('2014-05-02 09:16:14','YYYY-MM-DD HH24:MI:SS'),100,'D','N',10,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Default mail template',0,0,TO_DATE('2014-05-02 09:16:14','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- May 2, 2014 9:16:15 AM CEST
UPDATE AD_Column SET FKConstraintName='RDEFAULTMAILTEXT_ADUSER', FKConstraintType='N',Updated=TO_DATE('2014-05-02 09:16:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211209
;
-- May 14, 2014 10:24:01 AM COT
ALTER TABLE AD_User ADD R_DefaultMailText_ID NUMBER(10) DEFAULT NULL
;
-- May 14, 2014 10:24:02 AM COT
ALTER TABLE AD_User ADD CONSTRAINT RDefaultMailText_ADUser FOREIGN KEY (R_DefaultMailText_ID) REFERENCES r_mailtext(r_mailtext_id) DEFERRABLE INITIALLY DEFERRED
;
-- May 2, 2014 9:16:27 AM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,211208,202875,'b020eaab-a12c-4b5a-80ba-8c12f2cba674',0,118,2,TO_DATE('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,'The selected mail template will be automatically inserted when creating an email',1,'D','Y','Y','Y','N','N','N','N','N','Add Mail Text Automatically',520,TO_DATE('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,2)
;
-- May 2, 2014 9:16:28 AM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211209,202876,'ef99b478-48c3-4f2f-b276-7ae8695ab14a',0,118,2,TO_DATE('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Default mail template',530,TO_DATE('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=12640
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200072
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=202876
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=202875
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=6513
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=11525
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=6520
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=8342
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=6519
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=200405
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=200400
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=200403
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200401
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=200406
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=200402
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=200474
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=200475
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=200473
;
-- May 2, 2014 9:17:18 AM CEST
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2014-05-02 09:17:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202875
;
-- May 2, 2014 9:19:54 AM CEST
-- IDEMPIERE-1899
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=280, XPosition=5,Updated=TO_DATE('2014-05-02 09:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202875
;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 2, 2014 9:37:13 AM CEST
-- IDEMPIERE-1899
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200273,'43ee6fb2-59e7-4af2-bf73-b5baf5af5a3a',0,TO_DATE('2014-05-02 09:37:13','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Add default mail text content','I',TO_DATE('2014-05-02 09:37:13','YYYY-MM-DD HH24:MI:SS'),100,'AddDefaultMailTextContent')
;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 2, 2014 9:38:51 AM CEST
-- IDEMPIERE-1899
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2014-05-02 09:38:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211208
;
-- May 2, 2014 9:38:58 AM CEST
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2014-05-02 09:38:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211209
;
-- May 2, 2014 9:39:11 AM CEST
UPDATE AD_Field SET EntityType='D',Updated=TO_DATE('2014-05-02 09:39:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202876
;
-- May 2, 2014 9:39:13 AM CEST
UPDATE AD_Field SET EntityType='D',Updated=TO_DATE('2014-05-02 09:39:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202875
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=202876
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=202875
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=6513
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=11525
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=6520
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=8342
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=6519
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=200405
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=200400
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=200403
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=200401
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=200406
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=400,IsDisplayedGrid='Y' WHERE AD_Field_ID=200402
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=410,IsDisplayedGrid='Y' WHERE AD_Field_ID=200474
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=420,IsDisplayedGrid='Y' WHERE AD_Field_ID=200475
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=430,IsDisplayedGrid='Y' WHERE AD_Field_ID=200473
;
SELECT register_migration_script('201405021000_IDEMPIERE-1899.sql') FROM dual
;

View File

@ -0,0 +1,210 @@
-- May 2, 2014 9:15:14 AM CEST
-- IDEMPIERE-1899
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202698,'644f9b63-6ded-406e-abec-44d87375820a',0,'R_DefaultMailText_ID',TO_TIMESTAMP('2014-05-02 09:15:13','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Default mail template','Default mail template',TO_TIMESTAMP('2014-05-02 09:15:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:15:31 AM CEST
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202699,'05f5cb33-9346-4d6d-81c0-26c599af9b5a',0,'IsAddMailTextAutomatically',TO_TIMESTAMP('2014-05-02 09:15:30','YYYY-MM-DD HH24:MI:SS'),100,'The selected mail template will be automatically inserted when creating an email','D','Y','Add Mail Text Automatically','Add Mail Text Automatically',TO_TIMESTAMP('2014-05-02 09:15:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:15:50 AM CEST
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211208,'9cc67589-fb40-4206-9f03-4057670ed430',202699,0,20,114,'IsAddMailTextAutomatically',TO_TIMESTAMP('2014-05-02 09:15:49','YYYY-MM-DD HH24:MI:SS'),100,'N','The selected mail template will be automatically inserted when creating an email','D','N',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Add Mail Text Automatically',0,0,TO_TIMESTAMP('2014-05-02 09:15:49','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- May 2, 2014 9:15:54 AM CEST
ALTER TABLE AD_User ADD COLUMN IsAddMailTextAutomatically CHAR(1) DEFAULT 'N' CHECK (IsAddMailTextAutomatically IN ('Y','N')) NOT NULL
;
-- May 2, 2014 9:16:15 AM CEST
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211209,'2ecd8ac6-61d1-4062-85d9-2968e5a8f74c',202698,0,18,274,114,'R_DefaultMailText_ID',TO_TIMESTAMP('2014-05-02 09:16:14','YYYY-MM-DD HH24:MI:SS'),100,'D','N',10,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Default mail template',0,0,TO_TIMESTAMP('2014-05-02 09:16:14','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- May 2, 2014 9:16:15 AM CEST
UPDATE AD_Column SET FKConstraintName='RDEFAULTMAILTEXT_ADUSER', FKConstraintType='N',Updated=TO_TIMESTAMP('2014-05-02 09:16:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211209
;
-- May 14, 2014 10:24:01 AM COT
ALTER TABLE AD_User ADD COLUMN R_DefaultMailText_ID NUMERIC(10) DEFAULT NULL
;
-- May 14, 2014 10:24:02 AM COT
ALTER TABLE AD_User ADD CONSTRAINT RDefaultMailText_ADUser FOREIGN KEY (R_DefaultMailText_ID) REFERENCES r_mailtext(r_mailtext_id) DEFERRABLE INITIALLY DEFERRED
;
-- May 2, 2014 9:16:27 AM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,211208,202875,'b020eaab-a12c-4b5a-80ba-8c12f2cba674',0,118,2,TO_TIMESTAMP('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,'The selected mail template will be automatically inserted when creating an email',1,'D','Y','Y','Y','N','N','N','N','N','Add Mail Text Automatically',520,TO_TIMESTAMP('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,2)
;
-- May 2, 2014 9:16:28 AM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211209,202876,'ef99b478-48c3-4f2f-b276-7ae8695ab14a',0,118,2,TO_TIMESTAMP('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Default mail template',530,TO_TIMESTAMP('2014-05-02 09:16:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=12640
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200072
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=202876
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=202875
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=6513
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=11525
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=6520
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=8342
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=6519
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=200405
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=200400
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=200403
;
-- May 2, 2014 9:17:07 AM CEST
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200401
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=200406
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=200402
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=200474
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=200475
;
-- May 2, 2014 9:17:08 AM CEST
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=200473
;
-- May 2, 2014 9:17:18 AM CEST
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2014-05-02 09:17:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202875
;
-- May 2, 2014 9:19:54 AM CEST
-- IDEMPIERE-1899
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=280, XPosition=5,Updated=TO_TIMESTAMP('2014-05-02 09:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202875
;
-- May 2, 2014 9:37:14 AM CEST
-- IDEMPIERE-1899
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200273,'43ee6fb2-59e7-4af2-bf73-b5baf5af5a3a',0,TO_TIMESTAMP('2014-05-02 09:37:13','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Add default mail text content','I',TO_TIMESTAMP('2014-05-02 09:37:13','YYYY-MM-DD HH24:MI:SS'),100,'AddDefaultMailTextContent')
;
-- May 2, 2014 9:38:51 AM CEST
-- IDEMPIERE-1899
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2014-05-02 09:38:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211208
;
-- May 2, 2014 9:38:58 AM CEST
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2014-05-02 09:38:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211209
;
-- May 2, 2014 9:39:11 AM CEST
UPDATE AD_Field SET EntityType='D',Updated=TO_TIMESTAMP('2014-05-02 09:39:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202876
;
-- May 2, 2014 9:39:13 AM CEST
UPDATE AD_Field SET EntityType='D',Updated=TO_TIMESTAMP('2014-05-02 09:39:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202875
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=202876
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=202875
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=6513
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=11525
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=6520
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=8342
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=6519
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=200405
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=200400
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=200403
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=200401
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=200406
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=400,IsDisplayedGrid='Y' WHERE AD_Field_ID=200402
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=410,IsDisplayedGrid='Y' WHERE AD_Field_ID=200474
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=420,IsDisplayedGrid='Y' WHERE AD_Field_ID=200475
;
-- May 14, 2014 10:54:07 AM COT
UPDATE AD_Field SET SeqNoGrid=430,IsDisplayedGrid='Y' WHERE AD_Field_ID=200473
;
SELECT register_migration_script('201405021000_IDEMPIERE-1899.sql') FROM dual
;

View File

@ -402,6 +402,19 @@ public interface I_AD_User
*/
public boolean isActive();
/** Column name IsAddMailTextAutomatically */
public static final String COLUMNNAME_IsAddMailTextAutomatically = "IsAddMailTextAutomatically";
/** Set Add Mail Text Automatically.
* The selected mail template will be automatically inserted when creating an email
*/
public void setIsAddMailTextAutomatically (boolean IsAddMailTextAutomatically);
/** Get Add Mail Text Automatically.
* The selected mail template will be automatically inserted when creating an email
*/
public boolean isAddMailTextAutomatically();
/** Column name IsExpired */
public static final String COLUMNNAME_IsExpired = "IsExpired";
@ -646,6 +659,17 @@ public interface I_AD_User
/** Get Process Now */
public boolean isProcessing();
/** Column name R_DefaultMailText_ID */
public static final String COLUMNNAME_R_DefaultMailText_ID = "R_DefaultMailText_ID";
/** Set Default mail template */
public void setR_DefaultMailText_ID (int R_DefaultMailText_ID);
/** Get Default mail template */
public int getR_DefaultMailText_ID();
public org.compiere.model.I_R_MailText getR_DefaultMailText() throws RuntimeException;
/** Column name SalesRep_ID */
public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID";

View File

@ -31,7 +31,7 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20131031L;
private static final long serialVersionUID = 20140502L;
/** Standard Constructor */
public X_AD_User (Properties ctx, int AD_User_ID, String trxName)
@ -42,6 +42,8 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
setAD_User_ID (0);
setFailedLoginCount (0);
// 0
setIsAddMailTextAutomatically (false);
// N
setIsExpired (false);
// N
setIsFullBPAccess (true);
@ -584,6 +586,30 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
return (String)get_Value(COLUMNNAME_Fax);
}
/** Set Add Mail Text Automatically.
@param IsAddMailTextAutomatically
The selected mail template will be automatically inserted when creating an email
*/
public void setIsAddMailTextAutomatically (boolean IsAddMailTextAutomatically)
{
set_Value (COLUMNNAME_IsAddMailTextAutomatically, Boolean.valueOf(IsAddMailTextAutomatically));
}
/** Get Add Mail Text Automatically.
@return The selected mail template will be automatically inserted when creating an email
*/
public boolean isAddMailTextAutomatically ()
{
Object oo = get_Value(COLUMNNAME_IsAddMailTextAutomatically);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Expired.
@param IsExpired Expired */
public void setIsExpired (boolean IsExpired)
@ -1021,6 +1047,31 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
return false;
}
public org.compiere.model.I_R_MailText getR_DefaultMailText() throws RuntimeException
{
return (org.compiere.model.I_R_MailText)MTable.get(getCtx(), org.compiere.model.I_R_MailText.Table_Name)
.getPO(getR_DefaultMailText_ID(), get_TrxName()); }
/** Set Default mail template.
@param R_DefaultMailText_ID Default mail template */
public void setR_DefaultMailText_ID (int R_DefaultMailText_ID)
{
if (R_DefaultMailText_ID < 1)
set_Value (COLUMNNAME_R_DefaultMailText_ID, null);
else
set_Value (COLUMNNAME_R_DefaultMailText_ID, Integer.valueOf(R_DefaultMailText_ID));
}
/** Get Default mail template.
@return Default mail template */
public int getR_DefaultMailText_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_R_DefaultMailText_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException
{
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)

View File

@ -941,7 +941,7 @@ public final class EMail implements Serializable
(new ByteArrayDataSource (m_messageHTML, charSetName, "text/html")));
// Create Multipart and its parts to it
Multipart mp = new MimeMultipart();
Multipart mp = new MimeMultipart("related");
mp.addBodyPart(mbp_1);
if (log.isLoggable(Level.FINE)) log.fine("(multi) " + getSubject() + " - " + mbp_1);
@ -978,6 +978,11 @@ public final class EMail implements Serializable
mbp_2.setDataHandler(new DataHandler(ds));
mbp_2.setFileName(ds.getName());
if (log.isLoggable(Level.FINE)) log.fine("Added Attachment " + ds.getName() + " - " + mbp_2);
if (m_messageHTML != null && m_messageHTML.contains("cid:"+ds.getName())) {
mbp_2.setContentID("<" + ds.getName() + ">");
mbp_2.setDisposition(MimeBodyPart.INLINE);
}
mp.addBodyPart(mbp_2);
}

View File

@ -45,8 +45,11 @@ import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.Lookup;
import org.compiere.model.MAttachment;
import org.compiere.model.MAttachmentEntry;
import org.compiere.model.MClient;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MMailText;
import org.compiere.model.MUser;
import org.compiere.model.MUserMail;
import org.compiere.util.ByteArrayDataSource;
@ -56,6 +59,7 @@ import org.compiere.util.EMail;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkforge.ckez.CKeditor;
import org.zkoss.util.media.Media;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.event.Event;
@ -68,7 +72,6 @@ import org.zkoss.zul.Cell;
import org.zkoss.zul.Center;
import org.zkoss.zul.Div;
import org.zkoss.zul.South;
import org.zkoss.zul.Space;
/**
* EMail Dialog
@ -108,10 +111,16 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
this.setSclass("popup-dialog");
this.setClosable(true);
this.setBorder("normal");
this.setWidth("550px");
this.setWidth("80%");
this.setHeight("80%");
this.setShadow(true);
this.setMaximizable(true);
this.setSizable(true);
fMessage = new CKeditor();
fMessage.setCustomConfigurationsPath("/js/ckeditor/config.js");
fMessage.setToolbar("MyToolbar");
commonInit(from, to, subject, message, attachment);
} // EmailDialog
@ -183,9 +192,9 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
private Label lCc = new Label();
private Label lSubject = new Label();
private Label lAttachment = new Label();
private Textbox fMessage = new Textbox();
private CKeditor fMessage;
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
private Button bAddDefaultMailText;
private Div attachmentBox;
@Override
@ -195,6 +204,10 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
render();
} catch (Exception e) {
}
if (MUser.get(Env.getCtx()).isAddMailTextAutomatically()) {
addMailText();
}
}
/**
@ -301,11 +314,9 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
row = new Row();
rows.appendChild(row);
row.appendChild(new Space());
row.appendChild(fMessage);
fMessage.setHflex("1");
fMessage.setHeight("100%");
fMessage.setRows(10);
row.appendCellChild(fMessage, 2);
fMessage.setHflex("2");
fMessage.setHeight("350px");
confirmPanel.addActionListener(this);
@ -315,20 +326,25 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
btn.addEventListener(Events.ON_UPLOAD, this);
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Attachment"));
confirmPanel.addComponentsLeft(btn);
bAddDefaultMailText = new Button();
bAddDefaultMailText.setImage(ThemeManager.getThemeResource("images/DefaultMailText.png"));
bAddDefaultMailText.addEventListener(Events.ON_CLICK, this);
bAddDefaultMailText.setTooltiptext(Msg.getMsg(Env.getCtx(), "AddDefaultMailTextContent"));
if (new MUser(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()), null).getR_DefaultMailText_ID() > 0)
confirmPanel.addComponentsLeft(bAddDefaultMailText);
confirmPanel.getButton(ConfirmPanel.A_OK).setWidgetListener("onClick", "zAu.cmd0.showBusy(null)");
Borderlayout borderlayout = new Borderlayout();
this.appendChild(borderlayout);
borderlayout.setHflex("1");
borderlayout.setVflex("min");
Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
centerPane.appendChild(grid);
grid.setVflex("1");
grid.setHflex("1");
South southPane = new South();
southPane.setSclass("dialog-footer");
@ -432,7 +448,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
public void setMessage(String newMessage)
{
m_message = newMessage;
fMessage.setText(m_message);
fMessage.setValue(m_message);
// fMessage.setCaretPosition(0);
} // setMessage
@ -441,7 +457,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
*/
public String getMessage()
{
m_message = fMessage.getText();
m_message = fMessage.getValue();
return m_message;
} // getMessage
@ -481,7 +497,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
StringTokenizer st = new StringTokenizer(getTo(), " ,;", false);
String to = st.nextToken();
EMail email = m_client.createEMail(getFrom(), to, getSubject(), getMessage());
EMail email = m_client.createEMail(getFrom(), to, getSubject(), getMessage(), true);
String status = "Check Setup";
if (email != null)
{
@ -528,6 +544,8 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
addAttachment(dataSource, true);
}
}
else if (event.getTarget() == bAddDefaultMailText) // Insert the mail text at cursor (light side) ? or at the end (dark side) :D
addMailText();
}
/**
@ -652,4 +670,30 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
fCc.setValue(email);
}
}
} // VEMailDialog
private void addMailText()
{
MMailText mt = (MMailText) MUser.get(Env.getCtx()).getR_DefaultMailText();
if (mt.get_ID() > 0) {
mt.setPO(MUser.get(Env.getCtx()));
fMessage.setValue(getMessage() + "\n" + mt.getMailText(true));
MAttachment attachment = MAttachment.get(Env.getCtx(), MMailText.Table_ID, mt.get_ID());
if (attachment != null) {
MAttachmentEntry[] entries = attachment.getEntries();
for (MAttachmentEntry entry : entries) {
boolean alreadyAdded = false;
for (DataSource attach : attachments)
if (attach.getName().equals(entry.getName()))
alreadyAdded = true;
if (alreadyAdded)
continue;
byte[] data = entry.getData();
ByteArrayDataSource dataSource = new ByteArrayDataSource(data, entry.getContentType());
dataSource.setName(entry.getName());
addAttachment(dataSource, true);
}
}
}
}
} // WEMailDialog

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB