diff --git a/migration/i3.1/oracle/201605061900_Ticket_1005937.sql b/migration/i3.1/oracle/201605061900_Ticket_1005937.sql new file mode 100644 index 0000000000..2ac8d96883 --- /dev/null +++ b/migration/i3.1/oracle/201605061900_Ticket_1005937.sql @@ -0,0 +1,217 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- May 6, 2016 4:30:09 PM MYT +-- 1005937 Create new Field Reference Type for scanned image upload and display +INSERT INTO AD_Column (AD_Column_ID,SeqNoSelection,IsSyncDatabase,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,Updated,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,IsActive,CreatedBy,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,AD_Org_ID,Created,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Table_ID) VALUES (212756,0,'N',0,'N','N','N',0,'N',22,'N','N','N','Y','82704f4a-b798-4dbc-81ca-14b1a1a45506',TO_DATE('2016-05-06 16:30:02','YYYY-MM-DD HH24:MI:SS'),'Y','AD_Image_ID','Image or Icon','Images and Icon can be used to display supported graphic formats (gif, jpg, png). +You can either load the image (in the database) or point to a graphic via a URI (i.e. it can point to a resource, http address)','Image','N','Y',100,100,'N','N',0,0,TO_DATE('2016-05-06 16:30:02','YYYY-MM-DD HH24:MI:SS'),'U','N','N','N',1639,32,114) +; + +-- May 6, 2016 4:30:24 PM MYT +UPDATE AD_Column SET FKConstraintType='N', FKConstraintName='ADImage_ADUser',Updated=TO_DATE('2016-05-06 16:30:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212756 +; + +-- May 6, 2016 4:30:24 PM MYT +ALTER TABLE AD_User ADD AD_Image_ID NUMBER(10) DEFAULT NULL +; + +-- May 6, 2016 4:30:25 PM MYT +ALTER TABLE AD_User ADD CONSTRAINT ADImage_ADUser FOREIGN KEY (AD_Image_ID) REFERENCES ad_image(ad_image_id) DEFERRABLE INITIALLY DEFERRED +; + +-- May 6, 2016 4:31:04 PM MYT +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2016-05-06 16:31:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212756 +; + +-- May 6, 2016 4:31:30 PM MYT +INSERT INTO AD_Style (AD_Style_ID,AD_Style_UU,Name,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (200000,'2761af49-8165-416c-8522-b1acc548e492','User Image',0,0,TO_DATE('2016-05-06 16:31:24','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2016-05-06 16:31:24','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 6, 2016 4:33:40 PM MYT +INSERT INTO AD_StyleLine (InlineStyle,AD_StyleLine_UU,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_StyleLine_ID,DisplayLogic,Line,AD_Style_ID) VALUES ('width: 320px; height: 240px; position: absolute; right: 0;','ed12951e-c319-4242-9f76-e53709e1d53b',0,0,TO_DATE('2016-05-06 16:33:38','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2016-05-06 16:33:38','YYYY-MM-DD HH24:MI:SS'),100,200000,'@_Editor_IsGridView@=N',10,200000) +; + +-- May 6, 2016 4:42:03 PM MYT +INSERT INTO AD_Field (SortNo,AD_Field_ID,IsEncrypted,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,IsReadOnly,Help,AD_Org_ID,Updated,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,CreatedBy,UpdatedBy,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,Created,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,AD_Tab_ID,AD_FieldStyle_ID) VALUES (0,204217,'N',0,'N','N',3020,'Y','N','Images and Icon can be used to display supported graphic formats (gif, jpg, png). +You can either load the image (in the database) or point to a graphic via a URI (i.e. it can point to a resource, http address)',0,TO_DATE('2016-05-06 16:41:57','YYYY-MM-DD HH24:MI:SS'),'Image or Icon','Image','4e7be56e-d613-4efe-af41-40dd4825cd4b','Y','Y',100,100,'Y','Y',3020,4,'N',0,TO_DATE('2016-05-06 16:41:57','YYYY-MM-DD HH24:MI:SS'),3,1,'N','N',212756,'D',118,200000) +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=20, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204217 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2001 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=40,Updated=TO_DATE('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=300 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=50, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13755 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=60, ColumnSpan=2,Updated=TO_DATE('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=301 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=70, ColumnSpan=2,Updated=TO_DATE('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6522 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=80,Updated=TO_DATE('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=303 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=90,Updated=TO_DATE('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4623 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6516 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4260 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=302 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6521 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52010 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6515 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6517 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6514 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=180,Updated=TO_DATE('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6518 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=190,Updated=TO_DATE('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11679 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=200,Updated=TO_DATE('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12324 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12323 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=220,Updated=TO_DATE('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5883 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=230,Updated=TO_DATE('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5884 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=240,Updated=TO_DATE('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4261 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=260,Updated=TO_DATE('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200072 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=270,Updated=TO_DATE('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6513 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=280,Updated=TO_DATE('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11525 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8342 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=300,Updated=TO_DATE('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6519 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=310,Updated=TO_DATE('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200405 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=320,Updated=TO_DATE('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200400 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=330,Updated=TO_DATE('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200403 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=340,Updated=TO_DATE('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200401 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=350,Updated=TO_DATE('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200406 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=360,Updated=TO_DATE('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200402 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=370,Updated=TO_DATE('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200474 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=380,Updated=TO_DATE('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000975 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=390,Updated=TO_DATE('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000976 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=400,Updated=TO_DATE('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000977 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=410,Updated=TO_DATE('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000978 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=420,Updated=TO_DATE('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003008 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=430,Updated=TO_DATE('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003005 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10491 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6520 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003173 +; + +SELECT register_migration_script('201605061900_Ticket_1005937.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201605061900_Ticket_1005937.sql b/migration/i3.1/postgresql/201605061900_Ticket_1005937.sql new file mode 100644 index 0000000000..18d593fcee --- /dev/null +++ b/migration/i3.1/postgresql/201605061900_Ticket_1005937.sql @@ -0,0 +1,214 @@ +-- May 6, 2016 4:30:09 PM MYT +-- 1005937 Create new Field Reference Type for scanned image upload and display +INSERT INTO AD_Column (AD_Column_ID,SeqNoSelection,IsSyncDatabase,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,Updated,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,IsActive,CreatedBy,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,AD_Org_ID,Created,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Table_ID) VALUES (212756,0,'N',0,'N','N','N',0,'N',22,'N','N','N','Y','82704f4a-b798-4dbc-81ca-14b1a1a45506',TO_TIMESTAMP('2016-05-06 16:30:02','YYYY-MM-DD HH24:MI:SS'),'Y','AD_Image_ID','Image or Icon','Images and Icon can be used to display supported graphic formats (gif, jpg, png). +You can either load the image (in the database) or point to a graphic via a URI (i.e. it can point to a resource, http address)','Image','N','Y',100,100,'N','N',0,0,TO_TIMESTAMP('2016-05-06 16:30:02','YYYY-MM-DD HH24:MI:SS'),'U','N','N','N',1639,32,114) +; + +-- May 6, 2016 4:30:24 PM MYT +UPDATE AD_Column SET FKConstraintType='N', FKConstraintName='ADImage_ADUser',Updated=TO_TIMESTAMP('2016-05-06 16:30:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212756 +; + +-- May 6, 2016 4:30:24 PM MYT +ALTER TABLE AD_User ADD COLUMN AD_Image_ID NUMERIC(10) DEFAULT NULL +; + +-- May 6, 2016 4:30:25 PM MYT +ALTER TABLE AD_User ADD CONSTRAINT ADImage_ADUser FOREIGN KEY (AD_Image_ID) REFERENCES ad_image(ad_image_id) DEFERRABLE INITIALLY DEFERRED +; + +-- May 6, 2016 4:31:04 PM MYT +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2016-05-06 16:31:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212756 +; + +-- May 6, 2016 4:31:30 PM MYT +INSERT INTO AD_Style (AD_Style_ID,AD_Style_UU,Name,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (200000,'2761af49-8165-416c-8522-b1acc548e492','User Image',0,0,TO_TIMESTAMP('2016-05-06 16:31:24','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2016-05-06 16:31:24','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 6, 2016 4:33:40 PM MYT +INSERT INTO AD_StyleLine (InlineStyle,AD_StyleLine_UU,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_StyleLine_ID,DisplayLogic,Line,AD_Style_ID) VALUES ('width: 320px; height: 240px; position: absolute; right: 0;','ed12951e-c319-4242-9f76-e53709e1d53b',0,0,TO_TIMESTAMP('2016-05-06 16:33:38','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2016-05-06 16:33:38','YYYY-MM-DD HH24:MI:SS'),100,200000,'@_Editor_IsGridView@=N',10,200000) +; + +-- May 6, 2016 4:42:03 PM MYT +INSERT INTO AD_Field (SortNo,AD_Field_ID,IsEncrypted,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,IsReadOnly,Help,AD_Org_ID,Updated,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,CreatedBy,UpdatedBy,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,Created,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,AD_Tab_ID,AD_FieldStyle_ID) VALUES (0,204217,'N',0,'N','N',3020,'Y','N','Images and Icon can be used to display supported graphic formats (gif, jpg, png). +You can either load the image (in the database) or point to a graphic via a URI (i.e. it can point to a resource, http address)',0,TO_TIMESTAMP('2016-05-06 16:41:57','YYYY-MM-DD HH24:MI:SS'),'Image or Icon','Image','4e7be56e-d613-4efe-af41-40dd4825cd4b','Y','Y',100,100,'Y','Y',3020,4,'N',0,TO_TIMESTAMP('2016-05-06 16:41:57','YYYY-MM-DD HH24:MI:SS'),3,1,'N','N',212756,'D',118,200000) +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=20, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204217 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2001 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=300 +; + +-- May 6, 2016 4:44:15 PM MYT +UPDATE AD_Field SET SeqNo=50, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2016-05-06 16:44:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13755 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=60, ColumnSpan=2,Updated=TO_TIMESTAMP('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=301 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=70, ColumnSpan=2,Updated=TO_TIMESTAMP('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6522 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=303 +; + +-- May 6, 2016 4:44:16 PM MYT +UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2016-05-06 16:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4623 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6516 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4260 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=302 +; + +-- May 6, 2016 4:44:17 PM MYT +UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2016-05-06 16:44:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6521 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52010 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6515 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6517 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6514 +; + +-- May 6, 2016 4:44:18 PM MYT +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2016-05-06 16:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6518 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11679 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12324 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12323 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=220,Updated=TO_TIMESTAMP('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5883 +; + +-- May 6, 2016 4:44:19 PM MYT +UPDATE AD_Field SET SeqNo=230,Updated=TO_TIMESTAMP('2016-05-06 16:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5884 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4261 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200072 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6513 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11525 +; + +-- May 6, 2016 4:44:20 PM MYT +UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2016-05-06 16:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8342 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6519 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200405 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200400 +; + +-- May 6, 2016 4:44:21 PM MYT +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2016-05-06 16:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200403 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200401 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200406 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=360,Updated=TO_TIMESTAMP('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200402 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=370,Updated=TO_TIMESTAMP('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200474 +; + +-- May 6, 2016 4:44:22 PM MYT +UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2016-05-06 16:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000975 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000976 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=400,Updated=TO_TIMESTAMP('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000977 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=410,Updated=TO_TIMESTAMP('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000978 +; + +-- May 6, 2016 4:44:23 PM MYT +UPDATE AD_Field SET SeqNo=420,Updated=TO_TIMESTAMP('2016-05-06 16:44:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003008 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=430,Updated=TO_TIMESTAMP('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003005 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10491 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=6520 +; + +-- May 6, 2016 4:44:24 PM MYT +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2016-05-06 16:44:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1003173 +; + +SELECT register_migration_script('201605061900_Ticket_1005937.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index 996047711b..c7ea4d183d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -40,6 +40,8 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). + + + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index 37d596a4e2..30353c3a4d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -55,7 +55,6 @@ 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.Combobox; -import org.zkoss.zul.Image; import org.zkoss.zul.Menuitem; import org.zkoss.zul.Textbox; import org.zkoss.zul.impl.InputElement; @@ -97,7 +96,7 @@ public abstract class WEditor implements EventListener, PropertyChangeLis protected WEditorPopupMenu popupMenu; - private boolean tableEditor; + protected boolean tableEditor; private boolean isProcessParameter; @@ -632,10 +631,6 @@ public abstract class WEditor implements EventListener, PropertyChangeLis btn.setZclass("form-button " + zclass); } } - } else if (getComponent() instanceof Image) { - Image image = (Image) getComponent(); - image.setWidth("24px"); - image.setHeight("24px"); } else { if (!tableEditor) { if (getComponent() instanceof InputElement) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java index 7ad0f5e56c..760b5947a0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java @@ -16,6 +16,7 @@ package org.adempiere.webui.editor; import java.util.logging.Level; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.window.WImageDialog; @@ -46,7 +47,7 @@ public class WImageEditor extends WEditor private boolean m_mandatory; private boolean readwrite; - + /** Logger */ private static CLogger log = CLogger.getCLogger(WImageEditor.class); @@ -65,6 +66,7 @@ public class WImageEditor extends WEditor { AImage img = null; getComponent().setContent(img); + getComponent().setSclass("image-field"); } @Override @@ -102,10 +104,11 @@ public class WImageEditor extends WEditor @Override public void setReadWrite(boolean readWrite) { this.readwrite = readWrite; - if (readWrite) - getComponent().setStyle("cursor: pointer; border: 1px solid;"); - else - getComponent().setStyle("cursor: default; border: none;"); + if (readwrite) { + LayoutUtils.removeSclass("image-field-readonly", getComponent()); + } else { + LayoutUtils.addSclass("image-field-readonly", getComponent()); + } } @Override @@ -181,4 +184,13 @@ public class WImageEditor extends WEditor }); } } + + /* (non-Javadoc) + * @see org.adempiere.webui.editor.WEditor#fillHorizontal() + */ + @Override + public void fillHorizontal() { +// getComponent().setWidth(defaultWidth); +// getComponent().setHeight(defaultHeight); + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java index 84acfa61cc..b425a3f012 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java @@ -24,26 +24,31 @@ import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.ConfirmPanel; -import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Panel; +import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; +import org.apache.commons.codec.binary.Base64; import org.compiere.model.MImage; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.compiere.util.Util; import org.zkoss.image.AImage; import org.zkoss.util.media.Media; 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.UploadEvent; +import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; +import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.Image; import org.zkoss.zul.North; import org.zkoss.zul.Separator; import org.zkoss.zul.South; +import org.zkoss.zul.Space; /** * Base on the original Swing Image Dialog. @@ -95,7 +100,7 @@ public class WImageDialog extends Window implements EventListener } } - fileButton.setLabel(m_mImage.getName()); + fileNameTextbox.setValue(m_mImage.getName()); AEnv.showCenterScreen(this); } // WImageDialog @@ -107,12 +112,17 @@ public class WImageDialog extends Window implements EventListener /** */ private Borderlayout mainLayout = new Borderlayout(); private Panel parameterPanel = new Panel(); - private Label fileLabel = new Label(); private Button fileButton = new Button(); + private Button captureButton = new Button(); private Image image = new Image(); private ConfirmPanel confirmPanel = new ConfirmPanel(true,false,true,false,false,false); private boolean cancel = false; - + private Textbox fileNameTextbox = new Textbox(); + + private Div captureDiv; + private String defaultNameForCaptureImage = "CapturedImage"; + private Button cancelCaptureButton; + /** * Static Init * @throws Exception @@ -121,19 +131,35 @@ public class WImageDialog extends Window implements EventListener { this.setSclass("popup-dialog"); this.setBorder("normal"); - this.setWidth("450px"); - this.setHeight("550px"); + this.setWidth("640px"); + this.setHeight("540px"); this.setShadow(true); this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); this.setSizable(true); + this.setStyle("position: relative;"); + + captureDiv = new Div(); + this.appendChild(captureDiv); + captureDiv.setStyle("position: absolute;"); + captureDiv.setHeight("480px"); + captureDiv.setWidth("640px"); + captureDiv.setVisible(false); + captureDiv.addEventListener("onCaptureImage", this); + cancelCaptureButton = new Button(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Cancel"))); + LayoutUtils.addSclass("txt-btn", cancelCaptureButton); + cancelCaptureButton.setStyle("position: absolute; bottom: 5px; right: 3px;"); + this.appendChild(cancelCaptureButton); + cancelCaptureButton.addEventListener(Events.ON_CLICK, this); + cancelCaptureButton.setVisible(false); mainLayout.setParent(this); mainLayout.setHflex("1"); mainLayout.setVflex("1"); - fileLabel.setValue(Msg.getMsg(Env.getCtx(), "SelectFile") + ": "); - fileButton.setLabel("-"); + fileButton.setLabel("Upload"); LayoutUtils.addSclass("txt-btn", fileButton); + captureButton.setLabel("Capture"); + LayoutUtils.addSclass("txt-btn", captureButton); North north = new North(); north.setParent(mainLayout); @@ -142,8 +168,11 @@ public class WImageDialog extends Window implements EventListener Hbox hbox = new Hbox(); hbox.setAlign("center"); hbox.setPack("start"); - hbox.appendChild(fileLabel); hbox.appendChild(fileButton); + hbox.appendChild(new Space()); + hbox.appendChild(captureButton); + hbox.appendChild(new Space()); + hbox.appendChild(fileNameTextbox); parameterPanel.setStyle("padding: 5px"); parameterPanel.appendChild(hbox); @@ -167,6 +196,7 @@ public class WImageDialog extends Window implements EventListener // fileButton.setUpload(AdempiereWebUI.getUploadSetting()); fileButton.addEventListener(Events.ON_UPLOAD, this); + captureButton.addEventListener(Events.ON_CLICK, this); confirmPanel.addActionListener(Events.ON_CLICK, this); addEventListener(Events.ON_UPLOAD, this); @@ -182,6 +212,8 @@ public class WImageDialog extends Window implements EventListener { if (image.getContent() != null) { + if (!Util.isEmpty(fileNameTextbox.getValue())) + m_mImage.setName(fileNameTextbox.getValue()); m_mImage.saveEx(); } else if (m_mImage != null && m_mImage.getAD_Image_ID() > 0) @@ -201,7 +233,50 @@ public class WImageDialog extends Window implements EventListener { AImage img = null; image.setContent(img); - fileButton.setLabel("-"); + fileNameTextbox.setValue(null); + } + else if (e.getTarget() == captureButton) + { + captureDiv.setVisible(true); + cancelCaptureButton.setVisible(true); + mainLayout.setVisible(false); + String script = "var wgt = zk.Widget.$('#"+captureDiv.getUuid()+"');"; + script = script + "jq(wgt).photobooth(); "; + script = script + "jq(wgt).bind( 'image', function( event, dataUrl ){ zAu.send(new zk.Event(wgt, 'onCaptureImage', dataUrl, {toServer:true})); });"; + Clients.evalJavaScript(script); + } + else if (e.getName().equals("onCaptureImage")) + { + captureDiv.setVisible(false); + cancelCaptureButton.setVisible(false); + mainLayout.setVisible(true); + String dataUrl = (String) e.getData(); + if (!Util.isEmpty(dataUrl)) + { + String encodingPrefix = "base64,"; + int contentStartIndex = dataUrl.indexOf(encodingPrefix) + encodingPrefix.length(); + byte[] imageData = Base64.decodeBase64(dataUrl.substring(contentStartIndex).getBytes()); + AImage img = new AImage(defaultNameForCaptureImage, imageData); + image.setContent(img); + + if (m_mImage == null) + m_mImage = MImage.get (Env.getCtx(), 0); + m_mImage.setName(defaultNameForCaptureImage); + m_mImage.setBinaryData(imageData); + fileNameTextbox.setValue(defaultNameForCaptureImage); + } + String script = "var wgt = zk.Widget.$('#"+captureDiv.getUuid()+"');"; + script = script + "jq(wgt).data( 'photobooth').destroy(); "; + Clients.evalJavaScript(script); + } + else if (e.getTarget() == cancelCaptureButton) + { + captureDiv.setVisible(false); + cancelCaptureButton.setVisible(false); + mainLayout.setVisible(true); + String script = "var wgt = zk.Widget.$('#"+captureDiv.getUuid()+"');"; + script = script + "jq(wgt).data( 'photobooth').destroy(); "; + Clients.evalJavaScript(script); } } @@ -235,7 +310,7 @@ public class WImageDialog extends Window implements EventListener } // OK - fileButton.setLabel(imageFile.getName()); + fileNameTextbox.setValue(imageFile.getName()); invalidate(); // Save info @@ -259,4 +334,18 @@ public class WImageDialog extends Window implements EventListener return m_mImage.getAD_Image_ID(); return 0; } // getAD_Image_ID + + /** + * @return the defaultNameForCaptureImage + */ + public String getDefaultNameForCaptureImage() { + return defaultNameForCaptureImage; + } + + /** + * @param defaultNameForCaptureImage the defaultNameForCaptureImage to set + */ + public void setDefaultNameForCaptureImage(String defaultNameForCaptureImage) { + this.defaultNameForCaptureImage = defaultNameForCaptureImage; + } } // WImageDialog diff --git a/org.adempiere.ui.zk/js/photobooth_min.js b/org.adempiere.ui.zk/js/photobooth_min.js new file mode 100644 index 0000000000..6257b6a150 --- /dev/null +++ b/org.adempiere.ui.zk/js/photobooth_min.js @@ -0,0 +1,17 @@ +/** +* +* Photobooth.js version 0.7 +* +* build Thu Oct 17 2013 16:43:37 GMT-0700 (Pacific Daylight Time) +* +* CSS +*/ +window.addEventListener("load",function(){var s = document.createElement("style"); s.innerHTML=".photobooth{position:relative;font:11px arial,sans-serif;overflow:hidden;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.photobooth canvas{position:absolute;left:0;top:0}.photobooth .blind{position:absolute;left:0;top:0;opacity:0;width:100%;height:100%;background:#fff;z-index:1}.photobooth .blind.anim{transition:opacity 1500ms ease-out;-o-transition:opacity 1500ms ease-out;-moz-transition:opacity 1500ms ease-out;-webkit-transition:opacity 1500ms ease-out}.photobooth .warning{position:absolute;top:45%;background:#ffebeb;color:#cf0000;border:1px solid #cf0000;width:60%;left:50%;margin-left:-30%;display:none;padding:5px;z-index:10;text-align:center}.photobooth .warning span{text-decoration:underline;cursor:pointer;color:#333}.photobooth ul{width:30px;position:absolute;right:0;top:0;background:rgba( 0,0,0,.6 );height:190px;z-index:2;border-bottom-left-radius:5px}.photobooth ul li{width:30px;height:38px;background-repeat:no-repeat;background-position:center center;cursor:pointer;position:relative}.photobooth ul li:hover{background-color:#aaa}.photobooth ul li.selected{background-color:#ccc}.photobooth ul.noHSB{height:80px}.photobooth ul.noHSB li.hue,.photobooth ul.noHSB li.saturation,.photobooth ul.noHSB li.brightness{display:none}.photobooth ul li.hue{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgACAAYAwERAAIRAQMRAf/EAHgAAQEAAAAAAAAAAAAAAAAAAAkIAQEAAwAAAAAAAAAAAAAAAAAKBggLEAAAAwQLAAAAAAAAAAAAAAAAMQZBAjQ4A3MEdMQFdQcICTkRAAEBBAcGBwAAAAAAAAAAABExAAEhElECMjMEBQlhwgNzFDgVNRY3CBgK/9oADAMBAAIRAxEAPwBGOKPmqmNdT5FD2YgarLO67OVueIqrxF2tI/1Kn0jjjKfFcJZEt+5BAUCAaKuw+ThT3vC0wbFof+U4Dnv3WGl8Pu47A8vecwabKy8ZRVNKFdF3dY72fztbVdFu67axelcfrPkYlPTutCW7qqYCkwDf/9k=)}.photobooth ul li.saturation{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgACAAYAwERAAIRAQMRAf/EAGMAAAMAAAAAAAAAAAAAAAAAAAYICQEBAQEAAAAAAAAAAAAAAAAACAkKEAAABgMBAAAAAAAAAAAAAAAAwYIDMwZxAkQHEQABAgUFAAAAAAAAAAAAAAAAAQYxgQIyM3HBQgMH/9oADAMBAAIRAxEAPwAwo0rWdSFXHBYpnLZmWjVB/fLedIODu5Do81j1y2KE0CJlJA2uK5ZjtY2Kg//Z)}.photobooth ul li.brightness{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgACAAYAwERAAIRAQMRAf/EAFcAAQAAAAAAAAAAAAAAAAAAAAoBAQAAAAAAAAAAAAAAAAAAAAAQAAAEBQUAAAAAAAAAAAAAAACxAwgBMXECBXJzBDQ1EQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwAcTWfR4GtIwC5mITxNUDgAYA0joY3aRKwB/9k=)}.photobooth ul li.crop{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAICAYAAADjoT9jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEFJREFUeNpi/A8EDAjACMT/qUgzMCJZwMhAXQA2l4VGhsPNZKKR4XBfMMG8QiPASDcf0MIX/2FxgCJARRoMAAIMAK49Iv4yTUj5AAAAAElFTkSuQmCC)}.photobooth ul li.trigger{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAa9JREFUeNqc1M8rRFEUwPF5M4MhP8aPIiIS21lQk1Is5ceChZIdOytlI/+A7Ig/gGRhpYiNbKQsrBRFLPzYWJghNH7MjOd76qhr8m6vOfWpmffevefec987juu6AZ8RQhhBpJHJuT+CfsiEDo6wGjYeKMKn8b8Um/jCG2qQ0skjyOIWB9hFNyaN8bWSwGEHM5q9EVc6mUQ9YpjDHQbwoQkjuspDDKNEF9hjJDjFcoAEx653XEoJMYoVxNGBGPZRhzbL+HTYWLEtpO6V6EQ5kijTc7HFiwyssDwgyXsxhW8tkZSxAAksoj3n7P4G20hatviKE3RpqXKN4V5K4TE+IQ89WBI8ao0DFkP49krw+057xbyWxBY72LIdXsbjnlzf8/kRbtgSeO1APqonnwlu8tlBIYp9JojmkyCiX7Kf6MsngcSsvvO2aMZEPmcgEcea7ua/aNKGaC2RY0lwgTNsYwwNOlkrprGOJe2q/84vvegabdrrQyqomrSTyirHtbPKc+84x4L2qBazORi/s9KuC7QfBY3JC1UVBlGt16PallPap+Tas+7wWc8za1Ql8yPAAAzkXGo1lmDtAAAAAElFTkSuQmCC)}.photobooth .submenu{background:rgba( 0,0,0,.6 );position:absolute;width:100px;opacity:0;height:20px;padding:5px 10px;color:#fff;top:4px;left:-124px;border-radius:5px;-webkit-transition:opacity 500ms ease;-moz-transition:opacity 500ms ease;-o-transition:opacity 500ms ease;-msie-transition:opacity 500ms ease;transition:opacity 500ms ease}.photobooth li:hover .submenu{opacity:1}.photobooth .submenu .tip{width:4px;height:8px;position:absolute;right:-4px;top:50%;margin-top:-2px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAICAYAAADeM14FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADVJREFUeNpiYGBgmAnEDP///wdjJgYImMnIyAhmwATggowwLTCArAKrQDqyQDrcMGQlAAEGAAGOCdflbyWyAAAAAElFTkSuQmCC)}.photobooth .submenu .slider{width:100px;height:20px;position:relative}.photobooth .submenu .slider .track{height:2px;width:100px;position:absolute;top:9px;background:rgba(255,255,255,.6)}.photobooth .submenu .slider .handle{height:14px;width:2px;position:absolute;top:3;background:#fff;z-index:2}.photobooth .submenu .slider .handle div{position:absolute;z-index:3;width:20px;top:-3px;height:20px;cursor:w-resize;left:-9px}.resizehandle{position:absolute;z-index:1;width:100px;height:100px;left:30px;top:30px;cursor:move;outline:1500px solid rgba( 0,0,0,.35 );box-shadow:2px 2px 10px rgba(0,0,0,.5),0 0 3px #000;opacity:0;transition:opacity 500ms ease;-moz-transition:opacity 500ms ease;-o-transition:opacity 500ms ease;-webkit-transition:opacity 500ms ease}noindex:-o-prefocus,.resizehandle{outline:0!important}@-moz-document url-prefix(){.resizehandle{ box-shadow:none!important}}.resizehandle .handle{width:100%;height:100%;border:2px dashed #0da4d3;margin:-2px 0 0 -2px;z-index:3;position:relative}.resizehandle .handle div{width:18px;height:18px;position:absolute;right:-2px;bottom:-2px;z-index:4;cursor:se-resize;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHdJREFUeNpi/P//PwO5gIlcjXxLr/xnIlujsg7pNsM0AgEjE7kaSfIzusZ/d4n0M1aNxPgZWeMHC4RGIJuREV8847IRpBGvnwlpxBnPRGkEyYOcjYx5l1z+z3/8Pwij8NHlQWwUPxNrI4afSdUI9zNZGoF8gAADAOGvmx/e+CgVAAAAAElFTkSuQmCC);background-position:top left;background-repeat:no-repeat}"; document.head.appendChild(s);},false); +/** +* JS +*/ +Photobooth=function(e){e.length&&(e=e[0]);var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.oGetUserMedia||navigator.msieGetUserMedia||!1;this.onImage=function(){},this.getHueOffset=function(){return o},this.setHueOffset=function(e){v(e,"hue")&&(o=e)},this.getBrightnessOffset=function(){return a},this.setBrightnessOffset=function(e){v(e,"brightness")&&(a=e)},this.getSaturationOffset=function(){return u},this.setSaturationOffset=function(e){v(e,"saturation")&&(u=e)},this.pause=function(){l===!1&&(l=!0,c&&c.getVideoTracks&&c.getVideoTracks().forEach(function(track) { try { track.stop(); } catch (err){} }))},this.resume=function(){l===!0&&(l=!1,M())},this.destroy=function(){this.pause(),e.removeChild(b)},this.forceHSB=!1,this.isSupported=!!t,this.resize=function(e,t){if(e<200||t<200)throw"Error: Not enough space for Photobooth. Min height / width is 200 px";p=e,d=t,C.setMax(p,d),b.style.width=e+"px",b.style.height=t+"px",w.width=e,w.height=t,S.width=e,S.height=t,T.width=e,T.height=t};var n=function(e){e.stopPropagation(),e.cancelBubble=!0},r=function(e){this.startX=0,this.startY=0,e.addEventListener("mousedown",this,!1)};r.prototype.onStart=function(e,t){},r.prototype.onMove=function(e,t){},r.prototype.onStop=function(e,t){},r.prototype.handleEvent=function(e){this["fon"+e.type](e)},r.prototype.fonmousedown=function(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.onStart(this.startX,this.startY),document.addEventListener("mousemove",this,!1),document.addEventListener("mouseup",this,!1)},r.prototype.fonmousemove=function(e){this.onMove(e.clientX-this.startX,e.clientY-this.startY)},r.prototype.fonmouseup=function(e){this.onStop(e.clientX-this.startX,e.clientY-this.startY),document.removeEventListener("mousemove",this),document.removeEventListener("mouseup",this)};var i=function(e,t){e.innerHTML='';var i=50,s=50,o=e.getElementsByClassName("handle")[0],u=e.getElementsByClassName("slider")[0],a=new r(o);a.onMove=function(e){f(i+e)},a.onStop=function(e){i=s};var f=function(e){e>0&&e<100&&(s=e,o.style.left=e+"px",t((e-50)/100))},l=function(e){f(e.layerX),i=s};u.addEventListener("click",l,!1),o.addEventListener("click",n,!1)},s=function(e,t,i){this.setMax=function(e,n){t=e,i=n},this.getData=function(){return{x:s,y:o,width:u,height:a}},this.isActive=function(){return p},this.toggle=function(){p===!1?(d.style.opacity=1,p=!0):(d.style.opacity=0,p=!1)};var s=30,o=30,u=100,a=100,f=30,l=30,c=100,h=100,p=!1,d=document.createElement("div");d.className="resizehandle",d.innerHTML='
',e.appendChild(d);var v=d.getElementsByTagName("div")[0],m=new r(v);m.onMove=function(e,n){s+e+u0&&(f=s+e,d.style.left=f+"px"),o+n+a0&&(l=o+n,d.style.top=l+"px")},m.onStop=function(){s=f,o=l};var g=d.getElementsByTagName("div")[1];g.addEventListener("mousedown",n,!1);var y=new r(g);y.onMove=function(e,n){s+e+u18&&(c=u+e,d.style.width=c+"px"),o+n+a18&&(h=a+n,d.style.height=h+"px")},y.onStop=function(){u=c,a=h}},o=0,u=0,a=0,f=!1,l=!1,c=null,h=this,p=e.offsetWidth,d=e.offsetHeight,v=function(e,t){if(e<-0.5||e>.5)throw"Invalid value: "+t+" must be between 0 and 1";return!0},m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},g=function(e){return b.getElementsByClassName(e)[0]},y=function(e){return document.createElement(e)},b=y("div");b.className="photobooth",b.innerHTML='
Sorry, Photobooth.js is not supported by your browser
Please give Photobooth permission to use your Webcam. Try again
';var w=y("canvas"),E=w.getContext("2d"),S=b.getElementsByTagName("canvas")[0],x=S.getContext("2d"),T=y("video");T.autoplay=!0;var N=g("noWebcam");N.getElementsByTagName("span")[0].onclick=function(){M()},new i(g("hue"),function(e){o=e}),new i(g("saturation"),function(e){u=e}),new i(g("brightness"),function(e){a=e});var C=new s(b,p,d),k=g("crop");k.onclick=function(){C.toggle(),k.className==="crop"?k.className="crop selected":k.className="crop"};var L=g("blind");g("trigger").onclick=function(){L.className="blind",L.style.opacity=1,setTimeout(function(){L.className="blind anim",L.style.opacity=0},50);var e={};C.isActive()?e=C.getData():f?e={x:(p-T.videoWidth)/2,y:(d-T.videoHeight)/2,width:T.videoWidth,height:T.videoHeight}:e={x:0,y:0,width:p,height:d};var t=y("canvas");t.width=e.width,t.height=e.height;if(f)t.getContext("2d").drawImage(T,Math.max(0,e.x-(p-T.videoWidth)/2),Math.max(e.y-(d-T.videoHeight)/2),e.width,e.height,0,0,e.width,e.height);else{var n=x.getImageData(e.x,e.y,e.width,e.height);t.getContext("2d").putImageData(n,0,0)}h.onImage(t.toDataURL())};var A=function(e){c=e;try{T.src=(window.URL||window.webkitURL).createObjectURL(c),m(H)}catch(t){T.mozSrcObject=c,h.forceHSB===!1?(f=!0,b.appendChild(T),b.getElementsByTagName("ul")[0].className="noHSB"):T.addEventListener("canplay",function(){m(H)},!1),T.play()}},O=function(e){N.style.display="block"},M=function(){N.style.display="none",t.call(navigator,{video:!0},A,O)},_=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},D=function(e){return e>1?e-1:e<0?1+e:e},P=function(e){return e>1?1:e<0?0:e},H=function(){try{E.drawImage(T,0,0,p,d)}catch(e){}var t=E.getImageData(0,0,p,d),n=t.data;for(var r=0;r.5?b/(2-c-h):b/(c+h),c===i&&(v=((s-f)/b+(s