Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.util.*; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.Set; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.entity.util.EntityFindOptions + +def limit = 13 // set number of days +def sdf = new SimpleDateFormat("EEEE yyyy-MM-dd 00:00:00.000") +def sdf2 = new SimpleDateFormat("EEEE dd/MM/yyyy") +def sdfTime = new SimpleDateFormat("HH:mm") +def today = new Date() + +for(i in 0..limit){ + def date1 = sdf.format(today-i) + def date2 = sdf.format(today-i+1) + def parseDate1 = sdf.parse(date1) + def parseDate2 = sdf.parse(date2) + def timeStampDate1 = UtilDateTime.toTimestamp(parseDate1) + def timeStampDate2 = UtilDateTime.toTimestamp(parseDate2) + // make condition for distinct productId + def exprs = [] + exprs.add(EntityCondition.makeCondition("productContentTypeId",EntityOperator.EQUALS, "IMAGE")) + exprs.add(EntityCondition.makeCondition("statusId",EntityOperator.EQUALS, "IM_APPROVED")) + exprs.add(EntityCondition.makeCondition("purchaseFromDate", EntityOperator.GREATER_THAN_EQUAL_TO, timeStampDate1)) + exprs.add(EntityCondition.makeCondition("purchaseFromDate", EntityOperator.LESS_THAN, timeStampDate2)) + def fieldsToSelect = UtilMisc.toSet("productId") + def findOptions = new EntityFindOptions() + findOptions.setDistinct(true) + // query result + def productContentAndInfoList = delegator.findList("ProductContentAndInfo", EntityCondition.makeCondition(exprs, EntityOperator.AND), fieldsToSelect, null, findOptions, false) + + // finding time + def orderBy = UtilMisc.toList("productId") + def timeList = delegator.findList("ProductContentAndInfo", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, orderBy, null, false) + def groupByTimeList = timeList.groupBy{it.productId} + def tempTimeList = [] + groupByTimeList.each() { + key,value -> tempTimeList.add(value.purchaseFromDate) + } + + def time = [] + if(tempTimeList.size > 0){ + for(j in 0..tempTimeList.size-1){ + time.add(sdfTime.format(tempTimeList.get(j).get(0))) + } + } + def showDate = sdf2.format(today-i) + + switch (i) { + case 0: context.approved_0 = productContentAndInfoList; context.time_0 = time; context.date0 = showDate; + context.timeStampDate1_0 = timeStampDate1; context.timeStampDate2_0 = timeStampDate2; break; + case 1: context.approved_1 = productContentAndInfoList; context.time_1 = time; context.date1 = showDate; + context.timeStampDate1_1 = timeStampDate1; context.timeStampDate2_1 = timeStampDate2; break; + case 2: context.approved_2 = productContentAndInfoList; context.time_2 = time; context.date2 = showDate; + context.timeStampDate1_2 = timeStampDate1; context.timeStampDate2_2 = timeStampDate2; break; + case 3: context.approved_3 = productContentAndInfoList; context.time_3 = time; context.date3 = showDate; + context.timeStampDate1_3 = timeStampDate1; context.timeStampDate2_3 = timeStampDate2; break; + case 4: context.approved_4 = productContentAndInfoList; context.time_4 = time; context.date4 = showDate; + context.timeStampDate1_4 = timeStampDate1; context.timeStampDate2_4 = timeStampDate2; break; + case 5: context.approved_5 = productContentAndInfoList; context.time_5 = time; context.date5 = showDate; + context.timeStampDate1_5 = timeStampDate1; context.timeStampDate2_5 = timeStampDate2; break; + case 6: context.approved_6 = productContentAndInfoList; context.time_6 = time; context.date6 = showDate; + context.timeStampDate1_6 = timeStampDate1; context.timeStampDate2_6 = timeStampDate2; break; + case 7: context.approved_7 = productContentAndInfoList; context.time_7 = time; context.date7 = showDate; + context.timeStampDate1_7 = timeStampDate1; context.timeStampDate2_7 = timeStampDate2; break; + case 8: context.approved_8 = productContentAndInfoList; context.time_8 = time; context.date8 = showDate; + context.timeStampDate1_8 = timeStampDate1; context.timeStampDate2_8 = timeStampDate2; break; + case 9: context.approved_9 = productContentAndInfoList; context.time_9 = time; context.date9 = showDate; + context.timeStampDate1_9 = timeStampDate1; context.timeStampDate2_9 = timeStampDate2; break; + case 10: context.approved_10 = productContentAndInfoList; context.time_10 = time; context.date10 = showDate; + context.timeStampDate1_10 = timeStampDate1; context.timeStampDate2_10 = timeStampDate2; break; + case 11: context.approved_11 = productContentAndInfoList; context.time_11 = time; context.date11 = showDate; + context.timeStampDate1_11 = timeStampDate1; context.timeStampDate2_11 = timeStampDate2; break; + case 12: context.approved_12 = productContentAndInfoList; context.time_12 = time; context.date12 = showDate; + context.timeStampDate1_12 = timeStampDate1; context.timeStampDate2_12 = timeStampDate2; break; + case 13: context.approved_13 = productContentAndInfoList; context.time_13 = time; context.date13 = showDate; + context.timeStampDate1_13 = timeStampDate1; context.timeStampDate2_13 = timeStampDate2; break; + default: context.error = "error"; + } +} Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,144 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.base.util.string.*; +import org.ofbiz.product.image.ScaleImage; +import org.ofbiz.entity.condition.* + +context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); + +// make the image file formats +imageFilenameFormat = UtilProperties.getPropertyValue('catalog', 'image.filename.format'); +imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.server.path"), context); +imageUrlPrefix = UtilProperties.getPropertyValue('catalog', 'image.url.prefix'); +context.imageFilenameFormat = imageFilenameFormat; +context.imageServerPath = imageServerPath; +context.imageUrlPrefix = imageUrlPrefix; + +filenameExpander = FlexibleStringExpander.getInstance(imageFilenameFormat); +context.imageNameSmall = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'small' , id : productId]); +context.imageNameMedium = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'medium', id : productId]); +context.imageNameLarge = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'large' , id : productId]); +context.imageNameDetail = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'detail', id : productId]); +context.imageNameOriginal = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'original', id : productId]); + +// Start ProductContent stuff +productContent = null; +if (product) { + productContent = product.getRelated('ProductContent', null, ['productContentTypeId']); +} +context.productContent = productContent; +// End ProductContent stuff + +tryEntity = true; +if (request.getAttribute("_ERROR_MESSAGE_")) { + tryEntity = false; +} +if (!product) { + tryEntity = false; +} + +if ("true".equalsIgnoreCase((String) request.getParameter("tryEntity"))) { + tryEntity = true; +} +context.tryEntity = tryEntity; + +// UPLOADING STUFF +forLock = new Object(); +contentType = null; +String fileType = request.getParameter("upload_file_type"); +if (fileType) { + + context.fileType = fileType; + + fileLocation = filenameExpander.expandString([location : 'products', type : fileType, id : productId]); + filePathPrefix = ""; + filenameToUse = fileLocation; + if (fileLocation.lastIndexOf("/") != -1) { + filePathPrefix = fileLocation.substring(0, fileLocation.lastIndexOf("/") + 1); // adding 1 to include the trailing slash + filenameToUse = fileLocation.substring(fileLocation.lastIndexOf("/") + 1); + } + + int i1; + if (contentType && (i1 = contentType.indexOf("boundary=")) != -1) { + contentType = contentType.substring(i1 + 9); + contentType = "--" + contentType; + } + + defaultFileName = filenameToUse + "_temp"; + uploadObject = new HttpRequestFileUpload(); + uploadObject.setOverrideFilename(defaultFileName); + uploadObject.setSavePath(imageServerPath + "/" + filePathPrefix); + uploadObject.doUpload(request); + + clientFileName = uploadObject.getFilename(); + if (clientFileName) { + context.clientFileName = clientFileName; + } + + if (clientFileName && clientFileName.length() > 0) { + if (clientFileName.lastIndexOf(".") > 0 && clientFileName.lastIndexOf(".") < clientFileName.length()) { + filenameToUse += clientFileName.substring(clientFileName.lastIndexOf(".")); + } else { + filenameToUse += ".jpg"; + } + + context.clientFileName = clientFileName; + context.filenameToUse = filenameToUse; + + characterEncoding = request.getCharacterEncoding(); + imageUrl = imageUrlPrefix + "/" + filePathPrefix + java.net.URLEncoder.encode(filenameToUse, characterEncoding); + + try { + file = new File(imageServerPath + "/" + filePathPrefix, defaultFileName); + file1 = new File(imageServerPath + "/" + filePathPrefix, filenameToUse); + try { + file1.delete(); + } catch (Exception e) { + System.out.println("error deleting existing file (not neccessarily a problem)"); + } + file.renameTo(file1); + } catch (Exception e) { + e.printStackTrace(); + } + + if (imageUrl && imageUrl.length() > 0) { + context.imageUrl = imageUrl; + product.set(fileType + "ImageUrl", imageUrl); + + // call scaleImageInAllSize + if (fileType.equals("original")) { + result = ScaleImage.scaleImageInAllSize(context, filenameToUse, "main", "0"); + + if (result.containsKey("responseMessage") && result.get("responseMessage").equals("success")) { + imgMap = result.get("imageUrlMap"); + imgMap.each() { key, value -> + product.set(key + "ImageUrl", value); + } + } + } + + product.store(); + } + } +} + +context.productFeatures = delegator.findList("ProductFeature", EntityCondition.makeCondition([productFeatureTypeId : "SIZE", productFeatureCategoryId : "IMAGE"]), null, null, null, false); Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/automaticResize.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/automaticResize.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/automaticResize.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/automaticResize.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,150 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.base.util.string.*; +import org.ofbiz.product.image.ScaleImage; + + +context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); + +// make the image file formats +imageFilenameFormat = UtilProperties.getPropertyValue('catalog', 'image.filename.format'); +imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.server.path"), context); +imageUrlPrefix = UtilProperties.getPropertyValue('catalog', 'image.url.prefix'); +context.imageFilenameFormat = imageFilenameFormat; +context.imageServerPath = imageServerPath; +context.imageUrlPrefix = imageUrlPrefix; + +filenameExpander = FlexibleStringExpander.getInstance(imageFilenameFormat); +context.imageNameSmall = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'small' , id : productId]); +context.imageNameMedium = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'medium', id : productId]); +context.imageNameLarge = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'large' , id : productId]); +context.imageNameDetail = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'detail', id : productId]); +context.imageNameOriginal = imageUrlPrefix + "/" + filenameExpander.expandString([location : 'products', type : 'original', id : productId]); + +// Start ProductContent stuff +productContent = null; +if (product) { + productContent = product.getRelated('ProductContent', null, ['productContentTypeId']); +} +context.productContent = productContent; +// End ProductContent stuff + +tryEntity = true; +if (request.getAttribute("_ERROR_MESSAGE_")) { + tryEntity = false; +} +if (!product) { + tryEntity = false; +} + +if ("true".equalsIgnoreCase((String) request.getParameter("tryEntity"))) { + tryEntity = true; +} +context.tryEntity = tryEntity; + +// UPLOADING STUFF +forLock = new Object(); +String fileType = request.getParameter("upload_file_type"); + +if (fileType) { + if (request.getParameter("contentId")){ + contentId = request.getParameter("contentId"); + content = delegator.findOne("Content",[contentId : contentId], false); + + if (content) { + clientFileName = content.contentName + context.fileType = fileType; + + fileLocation = filenameExpander.expandString([location : 'products', type : fileType, id : productId]); + filePathPrefix = ""; + filenameToUse = fileLocation; + if (fileLocation.lastIndexOf("/") != -1) { + filePathPrefix = fileLocation.substring(0, fileLocation.lastIndexOf("/") + 1); // adding 1 to include the trailing slash + filenameToUse = fileLocation.substring(fileLocation.lastIndexOf("/") + 1); + } + + if (clientFileName) { + context.clientFileName = clientFileName; + } + + if (clientFileName && clientFileName.length() > 0) { + if (clientFileName.lastIndexOf(".") > 0 && clientFileName.lastIndexOf(".") < clientFileName.length()) { + filenameToUse += clientFileName.substring(clientFileName.lastIndexOf(".")); + } else { + filenameToUse += ".jpg"; + } + + context.clientFileName = clientFileName; + context.filenameToUse = filenameToUse; + context.productId = productId; + context.contentId = contentId; + + characterEncoding = request.getCharacterEncoding(); + imageUrl = imageUrlPrefix + "/" + filePathPrefix + java.net.URLEncoder.encode(filenameToUse, characterEncoding); + + try { + f1 = new File(imageServerPath + "/products/management/" + productId + "/" + clientFileName); + f2 = new File(imageServerPath + "/" + filePathPrefix, filenameToUse); + + InputStream input = new FileInputStream(f1); + OutputStream out = new FileOutputStream(f2); + + byte[] buf = new byte[1024]; + int len; + while ((len = input.read(buf)) > 0){ + out.write(buf, 0, len); + } + input.close(); + out.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + + if (imageUrl && imageUrl.length() > 0) { + context.imageUrl = imageUrl; + product.set(fileType + "ImageUrl", imageUrl); + + // call scaleImageInAllSize + if (fileType.equals("original")) { + result = ScaleImage.scaleImageInAllSize(context, filenameToUse, "main", "0"); + + if (result.containsKey("responseMessage") && result.get("responseMessage").equals("success")) { + imgMap = result.get("imageUrlMap"); + imgMap.each() { key, value -> + product.set(key + "ImageUrl", value); + } + } + } else { + result = ScaleImage.scaleImageManageInAllSize(context, filenameToUse, "main", "0", fileType); + } + + product.store(); + } + } + } else { + context.errorMessage = "ERROR, No existing Content found."; + } + } else { + context.errorMessage = "ERROR, Please choose image."; + } +} Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkAction.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkAction.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkAction.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkAction.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; + +Map paramMap = UtilHttp.getParameterMap(request); +def result +int rowCount = UtilHttp.getMultiFormRowCount(paramMap); +if (rowCount > 1) { + for (int i = 0; i < rowCount; i++) { + String thisSuffix = UtilHttp.MULTI_ROW_DELIMITER + i; + if(paramMap.get("action" +thisSuffix)){ + result = paramMap.get("action" +thisSuffix) + } + } +} +else { + result = paramMap.get("action_o_0") +} +if (result == null) { + result = "noAction"; +} +return result; Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkRejected.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkRejected.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkRejected.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/checkRejected.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; + +Map paramMap = UtilHttp.getParameterMap(request); +def rejected = false +int rowCount = UtilHttp.getMultiFormRowCount(paramMap); +if (rowCount > 1) { + for (int i = 0; i < rowCount; i++) { + String thisSuffix = UtilHttp.MULTI_ROW_DELIMITER + i; + if(paramMap.get("checkStatusId" +thisSuffix)){ + def temp = paramMap.get("checkStatusId" +thisSuffix) + def splitTemp = temp.split("/") + if(splitTemp[0].equals("IM_REJECTED")){ + rejected = true + } + } + } +} +else { + def temp = paramMap.get("checkStatusId_o_0") + def splitTemp = temp.split("/") + if(splitTemp[0].equals("IM_REJECTED")){ + rejected = true + } +} + +if(rejected){ + return "rejected" +} +else { + return "approved" +} Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.* +import org.ofbiz.entity.* +import org.ofbiz.entity.model.* + +import javax.servlet.* +import javax.servlet.http.* + +Locale locale = UtilHttp.getLocale(request); +String serverName = request.getServerName(); +String serverLocal = serverName.substring(serverName.lastIndexOf(".") + 1); + +def nameLocal; +def productTextData; +contentAssocs.each { contentAssoc -> + +content = delegator.findOne("Content",[contentId : contentAssoc.contentIdTo], false); +localeString = content.localeString; + + if (serverLocal == "au") { + nameLocal = "en_AU"; + } else if (serverLocal == "ca") { + nameLocal = "en_CA"; + } else if (serverLocal == "de") { + nameLocal = "de"; + } else if (serverLocal == "ie") { + nameLocal = "en_IE"; + } else if (serverLocal == "fr") { + nameLocal = "fr"; + } else if (serverLocal == "es") { + nameLocal = "es"; + } else if (serverLocal == "it") { + nameLocal = "it"; + } else if (serverLocal == "uk") { + nameLocal = "en_GB"; + } else if (serverLocal == "sg") { + nameLocal = "en_SG"; + } else { + nameLocal = "en_US"; + } + + if (localeString == nameLocal) { + electronicText = delegator.findOne("ElectronicText",[dataResourceId : content.dataResourceId], false); + productTextData = electronicText.textData; + } + +} + +if (productTextData == null) { + context.productTextData = product.productName; +} else { + context.productTextData = productTextData; +} + + + Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy (added) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy Fri Dec 24 15:22:49 2010 @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.entity.* +import org.ofbiz.base.util.* + +allSequenceNums = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE"], ["defaultSequenceNum"]) +nullSequenceNums = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE", "defaultSequenceNum":null]) +productContents = allSequenceNums - nullSequenceNums +def duplicate = 0 +if(parameters.defaultSequenceNum){ + findExisted = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE", "defaultSequenceNum":(Long)parameters.defaultSequenceNum]) + duplicate = findExisted.size() +} +if(duplicate > 1){ + context.parameters.defaultSequenceNum = (Long)productContents.defaultSequenceNum[productContents.size()-1] + 1 +} Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=1052521&r1=1052520&r2=1052521&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Fri Dec 24 15:22:49 2010 @@ -2670,6 +2670,302 @@ under the License. <response name="success" type="view" value="EditWebAnalyticsType"/> <response name="error" type="view" value="EditWebAnalyticsType"/> </request-map> + + <!-- ================ Image Management Requests ================= --> + <request-map uri="Imagemanagement"><security https="true" auth="true"/> + <response name="success" type="view" value="Imagemanagement"/> + </request-map> + <request-map uri="ImageGallery"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageGallery"/> + <response name="error" type="view" value="ImageGallery"/> + </request-map> + <request-map uri="ImageUpload"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageUpload"/> + <response name="error" type="view" value="ImageUpload"/> + </request-map> + <request-map uri="ImageApprove"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageApprove"/> + <response name="error" type="view" value="ImageApprove"/> + </request-map> + <request-map uri="ImageRejected"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageRejected"/> + <response name="error" type="view" value="ImageRejected"/> + </request-map> + <request-map uri="ImageFrames"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageFrames"/> + <response name="error" type="view" value="ImageFrames"/> + </request-map> + <request-map uri="ImageWatermarking"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageWatermarking"/> + <response name="error" type="view" value="ImageWatermarking"/> + </request-map> + <request-map uri="ImageCropping"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageCropping"/> + <response name="error" type="view" value="ImageCropping"/> + </request-map> + <request-map uri="ImageRotating"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageRotating"/> + <response name="error" type="view" value="ImageRotating"/> + </request-map> + <request-map uri="ImageShare"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageShare"/> + <response name="error" type="view" value="ImageShare"/> + </request-map> + <request-map uri="ImageReplace"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageReplace"/> + <response name="error" type="view" value="ImageReplace"/> + </request-map> + <request-map uri="setImageDetail"> + <security https="true" auth="true"/> + <event type="service-multi" invoke="setImageDetail"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ListImageManage"/> + </request-map> + <request-map uri="setImageThumbnail"> + <security https="true" auth="true"/> + <event type="simple" path="component://product/script/org/ofbiz/product/imagemanagement/ImageManagementEvents.xml" invoke="setImageThumbnail"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ListImageManage"/> + </request-map> + <request-map uri="updateStatusImageManagement"> + <security https="true" auth="true"/> + <event type="service-multi" invoke="updateStatusImageManagement"/> + <response name="success" type="request" value="checkRejected"/> + <response name="error" type="view" value="ImageApprove"/> + </request-map> + <request-map uri="addRejectedReasonImageManagement"> + <security https="true" auth="true"/> + <event type="service-multi" invoke="addRejectedReasonImageManagement"/> + <response name="success" type="view" value="ImageRejected"/> + <response name="error" type="view" value="ImageRejected"/> + </request-map> + <request-map uri="uploadFrame"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.FrameImage" invoke="uploadFrame"/> + <response name="success" type="request-redirect" value="ImageFrames"> + <redirect-parameter name="productId"/> + <redirect-parameter name="contentId"/> + <redirect-parameter name="dataResourceId"/> + </response> + <response name="error" type="request-redirect" value="ImageFrames"> + <redirect-parameter name="productId"/> + <redirect-parameter name="contentId"/> + <redirect-parameter name="dataResourceId"/> + </response> + </request-map> + <request-map uri="createImageFrame"> + <security https="true" auth="true"/> + <event type="service" invoke="addImageFrame"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view-last" value="ImageFrames"/> + </request-map> + <request-map uri="addImageForProduct"> + <security https="true" auth="true"/> + <event type="service" invoke="multipleUploadProductImages"/> + <response name="success" type="view" value="ImageUpload"/> + <response name="error" type="view" value="ImageUpload"/> + </request-map> + <request-map uri="removeImageUpload"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="removeProductContentAndImageFile"/> + <response name="success" type="view" value="ImageUpload"/> + <response name="error" type="view" value="ImageUpload"/> + </request-map> + <request-map uri="createWatermarkImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.WatermarkImage" invoke="createWatermarkImage"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ImageWatermarking"/> + </request-map> + <request-map uri="previewWatermarkImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.WatermarkImage" invoke="previewWatermarkImage"/> + <response name="success" type="view" value="viewPreviewImage"/> + <response name="error" type="view" value="viewPreviewImage"/> + </request-map> + <request-map uri="previewFrameImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.FrameImage" invoke="previewFrameImage"/> + <response name="success" type="view" value="viewPreviewImage"/> + <response name="error" type="request-redirect" value="ImageFrames"> + <redirect-parameter name="productId"/> + <redirect-parameter name="contentId"/> + <redirect-parameter name="dataResourceId"/> + </response> + </request-map> + <request-map uri="img"> + <security auth="false" https="false"/> + <event type="java" path="org.ofbiz.content.data.DataEvents" invoke="serveImage"/> + <response name="success" type="none"/> + </request-map> + <request-map uri="viewImage"> + <security https="false" auth="false"/> + <response name="success" type="view" value="viewImage"/> + <response name="error" type="view" value="viewImage"/> + </request-map> + <request-map uri="viewImages"> + <security https="true" auth="true"/> + <response name="success" type="view" value="viewImages"/> + <response name="error" type="view" value="viewImages"/> + </request-map> + <request-map uri="viewPreviewImage"> + <security https="true" auth="true"/> + <response name="success" type="view" value="viewPreviewImage"/> + <response name="error" type="view" value="viewPreviewImage"/> + </request-map> + <request-map uri="LookupProduct"> + <security auth="true" https="true"/> + <response name="success" type="view" value="LookupProduct"/> + </request-map> + <request-map uri="LookupImage"> + <security https="true" auth="true"/> + <response name="success" type="view" value="LookupImage"/> + <response name="error" type="view" value="LookupImage"/> + </request-map> + <request-map uri="replaceImageToExistImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.ReplaceImage" invoke="replaceImageToExistImage"/> + <response name="success" type="view" value="ListImageReplace"/> + <response name="error" type="view" value="ListImageReplace"/> + </request-map> + <request-map uri="addImageCaption"> + <security https="true" auth="true"/> + <event type="service" invoke="addImageCaption"/> + <response name="success" type="view" value="ListImageCaption"/> + <response name="error" type="view" value="ListImageCaption"/> + </request-map> + <request-map uri="CropImage"> + <security https="true" auth="true"/> + <event type="service" invoke="imageCrop"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ImageCropping"/> + </request-map> + <request-map uri="RotateImage"> + <security https="true" auth="true"/> + <event type="service" invoke="imageRotate"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ImageRotating"/> + </request-map> + <request-map uri="ListImageGallery"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListImageGallery"/> + <response name="error" type="view" value="ListImageGallery"/> + </request-map> + <request-map uri="ImageManage"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageManage"/> + <response name="error" type="view" value="ImageManage"/> + </request-map> + <request-map uri="ListImageManage"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ListImageManage"/> + </request-map> + <request-map uri="checkAction"> + <security https="true" auth="true"/> + <event type="groovy" path="component://product/webapp/catalog/WEB-INF/actions/imagemanagement/" invoke="checkAction.groovy"/> + <response name="frame" type="request" value="ImageFrames"/> + <response name="watermark" type="request" value="ImageWatermarking"/> + <response name="crop" type="request" value="ImageCropping"/> + <response name="rotate" type="request" value="ImageRotating"/> + <response name="noAction" type="request-redirect" value="ListImageManage"/> + </request-map> + <request-map uri="checkRejected"> + <security https="true" auth="true"/> + <event type="groovy" path="component://product/webapp/catalog/WEB-INF/actions/imagemanagement/" invoke="checkRejected.groovy"/> + <response name="approved" type="view" value="ImageApprove"/> + <response name="rejected" type="view" value="ImageRejected"/> + </request-map> + <request-map uri="ListImageReplace"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListImageReplace"/> + <response name="error" type="view" value="ListImageReplace"/> + </request-map> + <request-map uri="ImageRecentlyApproved"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ImageRecentlyApproved"/> + <response name="error" type="view" value="ImageRecentlyApproved"/> + </request-map> + <request-map uri="ListImageRecentlyApproved"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListImageRecentlyApproved"/> + <response name="error" type="view" value="ListImageRecentlyApproved"/> + </request-map> + <request-map uri="ListPeopleApproved"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListPeopleApproved"/> + <response name="error" type="view" value="ListPeopleApproved"/> + </request-map> + <request-map uri="ListPeopleRejected"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListPeopleRejected"/> + <response name="error" type="view" value="ListPeopleRejected"/> + </request-map> + <request-map uri="setPreviewWaterMark"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.WatermarkImage" invoke="setPreviewWaterMark"/> + <response name="success" type="view" value="viewPreviewImage"/> + <response name="error" type="view" value="viewPreviewImage"/> + </request-map> + <request-map uri="multipleUploadImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.ImageManagementServices" invoke="multipleUploadImage"/> + <response name="success" type="view" value="ImageUpload"/> + <response name="error" type="view" value="ImageUpload"/> + </request-map> + <request-map uri="progressUploadImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.virtualvillage.imagemanagement.ImageManagementServices" invoke="progressUploadImage"/> + <response name="success" type="view" value="main"/> + </request-map> + <request-map uri="AutomaticResize"> + <security https="true" auth="true"/> + <response name="success" type="view" value="AutomaticResize"/> + <response name="error" type="view" value="AutomaticResize"/> + </request-map> + <request-map uri="ListAutomaticResize"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListAutomaticResize"/> + <response name="error" type="view" value="ListAutomaticResize"/> + </request-map> + <request-map uri="UploadProductImageForManageMent"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListAutomaticResize"/> + </request-map> + <request-map uri="chooseFrameImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.FrameImage" invoke="chooseFrameImage"/> + <response name="success" type="request-redirect" value="ImageFrames"> + <redirect-parameter name="productId"/> + <redirect-parameter name="contentId"/> + <redirect-parameter name="dataResourceId"/> + </response> + <response name="error" type="request-redirect" value="ImageFrames"> + <redirect-parameter name="productId"/> + <redirect-parameter name="contentId"/> + <redirect-parameter name="dataResourceId"/> + </response> + </request-map> + <request-map uri="LookupImageFrame"> + <security https="true" auth="true"/> + <response name="success" type="view" value="LookupImageFrame"/> + </request-map> + <request-map uri="deletePreviewWatermarkImage"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.imagemanagement.WatermarkImage" invoke="deletePreviewWatermarkImage"/> + <response name="success" type="view" value="ListImageManage"/> + <response name="error" type="view" value="ImageWatermarking"/> + </request-map> <!-- ================ Lookup Requests ================= --> <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map> @@ -2906,5 +3202,34 @@ under the License. <view-map name="LookupPerson" page="component://party/widget/partymgr/LookupScreens.xml#LookupPerson" type="screen"/> <view-map name="LookupPreferredContactMech" type="screen" page="component://marketing/widget/ContactListScreens.xml#LookupPreferredContactMech"/> <view-map name="LookupContactList" type="screen" page="component://party/widget/partymgr/PartyContactListScreens.xml#ListLookupContactList"/> + + <!-- Image Management request mappings --> + <view-map name="Imagemanagement" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#Imagemanagement"/> + <view-map name="ImageGallery" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageGallery" type="screen"/> + <view-map name="ImageUpload" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageUpload" type="screen"/> + <view-map name="ImageApprove" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageApprove" type="screen"/> + <view-map name="ImageRejected" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageRejected" type="screen"/> + <view-map name="ImageFrames" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageFrames" type="screen"/> + <view-map name="ImageWatermarking" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageWatermarking" type="screen"/> + <view-map name="ImageCropping" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageCropping" type="screen"/> + <view-map name="ImageRotating" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageRotating" type="screen"/> + <view-map name="ImageShare" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageShare" type="screen"/> + <view-map name="ImageReplace" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageReplace" type="screen"/> + <view-map name="viewImage" page="component://product/widget/catalog/ImageManagementScreens.xml#ViewImage" type="screen"/> + <view-map name="viewImages" page="component://product/widget/catalog/ImageManagementScreens.xml#ViewImages" type="screen"/> + <view-map name="viewPreviewImage" page="component://product/widget/catalog/ImageManagementScreens.xml#ViewPreviewImage" type="screen"/> + <view-map name="LookupImage" page="component://product/widget/catalog/ImageManagementScreens.xml#LookupImage" type="screen"/> + <view-map name="LookupProduct" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProduct"/> + <view-map name="ListImageGallery" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListImageGallery"/> + <view-map name="ImageManage" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageManage"/> + <view-map name="ListImageManage" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListImageManage"/> + <view-map name="ListImageReplace" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListImageReplace"/> + <view-map name="ImageRecentlyApproved" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ImageRecentlyApproved"/> + <view-map name="ListImageRecentlyApproved" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListImageRecentlyApproved"/> + <view-map name="ListPeopleApproved" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListPeopleApproved"/> + <view-map name="ListPeopleRejected" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListPeopleRejected"/> + <view-map name="AutomaticResize" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#AutomaticResize"/> + <view-map name="ListAutomaticResize" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#ListAutomaticResize"/> + <view-map name="LookupImageFrame" type="screen" page="component://product/widget/catalog/ImageManagementScreens.xml#LookupImageFrame"/> <!-- end of view mappings --> </site-conf> Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/web.xml?rev=1052521&r1=1052520&r2=1052521&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/web.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/web.xml Fri Dec 24 15:22:49 2010 @@ -60,7 +60,7 @@ under the License. </init-param> <init-param> <param-name>allowedPaths</param-name> - <param-value>/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/includes/maincss.css</param-value> + <param-value>/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/includes/maincss.css:/imagemanagement:/products</param-value> </init-param> <init-param> <param-name>errorCode</param-name> @@ -88,11 +88,25 @@ under the License. <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> + + <servlet> + <servlet-name>ImageUrlServlet</servlet-name> + <display-name>ImageUrlServlet</display-name> + <description>Image URL Servlet</description> + <servlet-class>org.ofbiz.product.imagemanagement.ImageUrlServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> <servlet-name>ControlServlet</servlet-name> <url-pattern>/control/*</url-pattern> </servlet-mapping> + <servlet-mapping> + <servlet-name>ImageUrlServlet</servlet-name> + <url-pattern>/images/*</url-pattern> + </servlet-mapping> + <session-config> <session-timeout>60</session-timeout> <!-- in minutes --> </session-config> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AddMultipleImages.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AddMultipleImages.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AddMultipleImages.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AddMultipleImages.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,71 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<form id="addMultipleImagesForm" name="addMultipleImagesForm" method="post" action="<@ofbizUrl>addImageForProduct</@ofbizUrl>" enctype="multipart/form-data"> +<br/> +<div class="label">Product ID / SKU <@htmlTemplate.lookupField name="productId" id="productId" formName="addMultipleImagesForm" fieldFormName="LookupProduct"/></div> +<br/> +<br/> + <table> + <tbody> + <tr> + <td> + <select name="imageResize" > + <#list productFeatures as productFeature> + <option value="${productFeature.productFeatureId?if_exists}">${productFeature.description?if_exists}</option> + </#list> + <option selected="" value="">Do not resize</option> + </select> + </td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageOne"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageTwo"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageThree"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageFour"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageFive"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageSix"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageSeven"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageEight"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageNine"/></td> + </tr> + <tr> + <td><input type="file" size="20" name="additionalImageTen"/></td> + </tr> + <tr> + <td><input type="submit" value='${uiLabelMap.CommonUpload}'/></td> + </tr> + </tbody> + </table> +</form> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AutomaticResize.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AutomaticResize.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AutomaticResize.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/AutomaticResize.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,111 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<#if product?exists> + <table cellspacing="0" class="basic-table"> + <tr> + <td width="20%" align="right" valign="top"> + <div><b>${uiLabelMap.ProductSmallImage}</b></div> + <#if (product.smallImageUrl)?exists> + <a href="<@ofbizContentUrl>${(product.smallImageUrl)?if_exists}</@ofbizContentUrl>" target="_blank"><img alt="Small Image" src="<@ofbizContentUrl>${(product.smallImageUrl)?if_exists}</@ofbizContentUrl>" height="40" width="40"/></a> + </#if> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="text" name="smallImageUrl" value="${(product.smallImageUrl)?default('')}" readOnly="readonly" onclick="javascript:select();" size="60" maxlength="255"/> + </td> + </tr> + <tr> + <td width="20%" align="right" valign="top"> + <div><b>${uiLabelMap.ProductMediumImage}</b></div> + <#if (product.mediumImageUrl)?exists> + <a href="<@ofbizContentUrl>${product.mediumImageUrl}</@ofbizContentUrl>" target="_blank"><img alt="Medium Image" src="<@ofbizContentUrl>${product.mediumImageUrl}</@ofbizContentUrl>" height="40" width="40"/></a> + </#if> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="text" name="mediumImageUrl" value="${(product.mediumImageUrl)?default('')}" readOnly="readonly" onclick="javascript:select();" size="60" maxlength="255"/> + </td> + </tr> + <tr> + <td width="20%" align="right" valign="top"> + <div><b>${uiLabelMap.ProductLargeImage}</b></div> + <#if (product.largeImageUrl)?exists> + <a href="<@ofbizContentUrl>${product.largeImageUrl}</@ofbizContentUrl>" target="_blank"><img alt="Large Image" src="<@ofbizContentUrl>${product.largeImageUrl}</@ofbizContentUrl>" height="40" width="40"/></a> + </#if> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="text" name="largeImageUrl" value="${(product.largeImageUrl)?default('')}" readOnly="readonly" onclick="javascript:select();" size="60" maxlength="255"/> + </td> + </tr> + <tr> + <td width="20%" align="right" valign="top"> + <div><b>${uiLabelMap.ProductDetailImage}</b></div> + <#if (product.detailImageUrl)?exists> + <a href="<@ofbizContentUrl>${product.detailImageUrl}</@ofbizContentUrl>" target="_blank"><img alt="Detail Image" src="<@ofbizContentUrl>${product.detailImageUrl}</@ofbizContentUrl>" height="40" width="40"/></a> + </#if> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="text" name="detailImageUrl" value="${(product.detailImageUrl)?default('')}" readOnly="readonly" onclick="javascript:select();" size="60" maxlength="255"/> + </td> + </tr> + <tr> + <td width="20%" align="right" valign="top"> + <div><b>${uiLabelMap.ProductOriginalImage}</b></div> + <#if (product.originalImageUrl)?exists> + <a href="<@ofbizContentUrl>${product.originalImageUrl}</@ofbizContentUrl>" target="_blank"><img alt="Original Image" src="<@ofbizContentUrl>${product.originalImageUrl}</@ofbizContentUrl>" height="40" width="40"/></a> + </#if> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="text" name="originalImageUrl" value="${(product.originalImageUrl)?default('')}" readOnly="readonly" onclick="javascript:select();" size="60" maxlength="255"/> + </td> + </tr> + </table> + <script language="JavaScript" type="text/javascript"> + function setUploadUrl(newUrl) { + var toExec = 'document.imageUploadForm.action="' + newUrl + '";'; + eval(toExec); + }; + </script> + <form method="post" action="<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=original</@ofbizUrl>" style="margin: 0;" name="imageUploadForm"> + <table cellspacing="0" class="basic-table"> + <tr> + <td width="6%" > + <div><b>Choose Image</b></div> + </td> + <td width="15%" valign="top"> + <span class="field-lookup"> + <@htmlTemplate.lookupField name="contentId" id="contentId" formName="imageUploadForm" fieldFormName="LookupImage?productId=${productId}"/> + </span> + </td> + <td> </td> + <td width="80%" colspan="4" valign="top"> + <input type="radio" name="upload_file_type_bogus" value="small" onclick='setUploadUrl("<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=small</@ofbizUrl>");'/>${uiLabelMap.CommonSmall} + <input type="radio" name="upload_file_type_bogus" value="medium" onclick='setUploadUrl("<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=medium</@ofbizUrl>");'/>${uiLabelMap.CommonMedium} + <input type="radio" name="upload_file_type_bogus" value="large"onclick='setUploadUrl("<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=large</@ofbizUrl>");'/>${uiLabelMap.CommonLarge} + <input type="radio" name="upload_file_type_bogus" value="detail" onclick='setUploadUrl("<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=detail</@ofbizUrl>");'/>${uiLabelMap.CommonDetail} + <input type="radio" name="upload_file_type_bogus" value="original" checked="checked" onclick='setUploadUrl("<@ofbizUrl>UploadProductImageForManageMent?productId=${productId}&upload_file_type=original</@ofbizUrl>");'/>${uiLabelMap.ProductOriginal} + <input type="submit" class="smallSubmit" value="${uiLabelMap.ProductUploadImage}"/> + </td> + </tr> + </table> + </form> +</#if> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageCrop.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageCrop.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageCrop.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageCrop.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,61 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<script src="/catalog/imagemanagement/js/jquery.min.js"></script> +<script src="/catalog/imagemanagement/js/jquery.Jcrop.js"></script> +<link rel="stylesheet" href="/catalog/imagemanagement/js/jquery.Jcrop.css" type="text/css" /> +<script type="text/javascript"> +jQuery.noConflict(); +jQuery(document).ready(function(){ + jQuery('td.cropbox img').Jcrop({ + onChange: showPreview, + onSelect: showPreview + }); +}); + +var imgWidth = jQuery('td.cropbox img').width(); +var imgHeight = jQuery('td.cropbox img').height(); +var imageUrl = jQuery('#ImageCropping_imageURL').val(); +var imageName = jQuery('#ImageCropping_imageName').val(); +var productId = jQuery('#ImageCropping_productId').val(); + +if (imageName != "") { + jQuery('#ImageCropping tr').append("<td class='label'><span>Preview</span></td><td><div style='width:100px;height:100px;overflow:hidden;'><img src='"+imageUrl+"' id='preview' /></div></td>"); + jQuery('#ImageCropping tbody').append("<tr><td><input type='submit' value='Crop' name='submitButton' class='smallSubmit'/></td></tr>"); + jQuery('#ImageCropping tbody').append("<tr><td><a class='buttontext' title=' ' href='/catalog/control/ListImageManage?productId="+productId+"'>Cancel</a></td></tr>"); +} + +function showPreview(coords){ + jQuery('#ImageCropping_imageX').val(coords.x); + jQuery('#ImageCropping_imageY').val(coords.y); + jQuery('#ImageCropping_imageW').val(coords.w); + jQuery('#ImageCropping_imageH').val(coords.h); + + if (parseInt(coords.w) > 0){ + var rx = 100 / coords.w; + var ry = 100 / coords.h; + + jQuery('#preview').css({ + width: Math.round(rx * imgWidth) + 'px', + height: Math.round(ry * imgHeight) + 'px', + marginLeft: '-' + Math.round(rx * coords.x) + 'px', + marginTop: '-' + Math.round(ry * coords.y) + 'px' + }); + } +} +</script> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,70 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<script type="text/javascript"> + jQuery.noConflict(); + var host = document.location.host; + jQuery(document).ready(function() { + var productId = jQuery('#ImageFrames_productId').val(); + var imageName = jQuery('#ImageFrames_imageName').val(); + }); + jQuery(window).load(function() { + var width = jQuery('td.image-src img').width(); + var height = jQuery('td.image-src img').height(); + jQuery('td.image-src img').css("width", 200); + var dimention = width + " x " + height + " pixels"; + jQuery('td.dimention').text(dimention); + + var widthFrame = jQuery('td.image-fr img').width(); + var heightFrame = jQuery('td.image-fr img').height(); + jQuery('td.image-fr img').css("width", 200); + var dimentionFrame = widthFrame + " x " + heightFrame + " pixels"; + jQuery('td.frameDimention').text(dimentionFrame); + }); + function setTargetWindows(target) { + if ((target == "upload") || (target == "choose")) { + jQuery('#ImageFrames').attr("target", "_self"); + } else { + jQuery('#ImageFrames').attr("target", target); + } + + if (target == "upload") { + document.ImageFrames.action = "uploadFrame?productId=" + jQuery('#ImageFrames_productId').val() + "&contentId=" + jQuery('#ImageFrames_contentId').val() + "&dataResourceId="+ jQuery('#ImageFrames_dataResourceId').val() + "&frameExistDataResourceId="+ jQuery('#ImageFrames_frameDataResourceId').val() + "&frameExistContentId="+ jQuery('#ImageFrames_frameContentId').val(); + } else if (target == "choose") { + document.ImageFrames.action = "chooseFrameImage?productId=" + jQuery('#ImageFrames_productId').val() + "&contentId=" + jQuery('#ImageFrames_contentId').val() + "&dataResourceId="+ jQuery('#ImageFrames_dataResourceId').val() + "&frameExistDataResourceId="+ jQuery('#ImageFrames_frameDataResourceId').val() + "&frameExistContentId="+ jQuery('#ImageFrames_frameContentId').val() + "&frameContentId="+jQuery('#0_lookupId_ImageFrames_imageFrameContentId').val(); + } else if (target == "new") { + document.ImageFrames.action = 'previewFrameImage'; + } else { + document.ImageFrames.action = 'createImageFrame'; + } + + if ((target != "upload") && (target != "choose")) { + var width = jQuery('#ImageFrames_imageWidth').val(); + var hieght = jQuery('#ImageFrames_imageHeight').val(); + if ((width == "") || (hieght == "")) { + jQuery('#ImageFrames').attr("target", "_self"); + } + } + } + function setUploadTarget(target) { + jQuery('#ImageFrames').attr("target", target); + } + function deletePreviewFrameImage() { + jQuery.post("deleteFrameImage"); + } +</script> \ No newline at end of file Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageGallery.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageGallery.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageGallery.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageGallery.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,74 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%"> + <#assign imageIndex = 0> + <#if productContentAndInfos?has_content> + <#if product?has_content> + <h1><b>${product.productId}</b></h1> + </#if> + <#assign productName = productTextData > + <#assign seoUrl = productName.replaceAll(" ", "-") > + <#assign alt_row = false> + <#list productContentAndInfos as productContentAndInfo> + <#assign contentAssocs = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", productContentAndInfo.contentId?if_exists, "contentAssocTypeId", "IMAGE_THUMBNAIL"))/> + <#if contentAssocs?has_content> + <#list contentAssocs as contentAssoc> + <#assign ImageContent = delegator.findByPrimaryKey("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo))?if_exists> + <#assign contentDataResourceView = delegator.findByPrimaryKey("ContentDataResourceView", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentAssoc.contentIdTo, "drDataResourceId", ImageContent.dataResourceId))?if_exists> + <#assign contentName = productContentAndInfo.contentName> + <#if imageIndex < 7> + <td style="vertical-align:bottom"> + <table> + <tbody> + <tr valign="middle"> + <td align="center"><a href="/catalog/images/${seoUrl}-${product.productId}/${seoUrl}-${contentName}" target="_blank"><img src="<@ofbizContentUrl>${(contentDataResourceView.drObjectInfo)?if_exists}</@ofbizContentUrl>" vspace="5" hspace="5" alt=""/></a></td> + </tr> + <tr valign="middle"> + <td align="center"><a href="javascript:lookup_popup2('ImageShare?contentId=${productContentAndInfo.contentId}&dataResourceId=${productContentAndInfo.dataResourceId}&seoUrl=/catalog/images/${seoUrl}-${product.productId}/${seoUrl}-${contentName}','' ,500,500);" class="buttontext">Share</a></td> + </tr> + <br/> + </tbody> + </table> + </td> + <#assign imageIndex = imageIndex+1> + <#else> + <#assign imageIndex = 0> + <tr></tr> + <td style="vertical-align:bottom"> + <table> + <tbody> + <tr valign="middle"> + <td align="center"><a href="/catalog/images/${seoUrl}-${product.productId}/${seoUrl}-${contentName}" target="_blank"><img src="<@ofbizContentUrl>${(contentDataResourceView.drObjectInfo)?if_exists}</@ofbizContentUrl>" vspace="5" hspace="5" alt=""/></a></td> + </tr> + <tr valign="middle"> + <td align="center"><a href="javascript:lookup_popup2('ImageShare?contentId=${productContentAndInfo.contentId}&dataResourceId=${productContentAndInfo.dataResourceId}&seoUrl=/catalog/images/${seoUrl}-${product.productId}/${seoUrl}-${contentName}','' ,500,500);" class="buttontext">Share</a></td> + </tr> + <br/> + </tbody> + </table> + </td> + <#assign imageIndex = imageIndex+1> + </#if> + </#list> + </#if> + </#list> + </#if> +</table> +<br/> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRecentlyApproved.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRecentlyApproved.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRecentlyApproved.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRecentlyApproved.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,245 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<table cellspacing="0" class="basic-table"> + <td style="vertical-align:top;"> + <table> + <#if approved_0?has_content> + <div class="label">${date0}</div> + <br/> + <#assign alt_row = false> + <#list approved_0 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_0}&date2=${timeStampDate2_0}&showDate=${date0}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_0[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_1?has_content> + <div class="label">${date1}</div> + <br/> + <#assign alt_row = false> + <#list approved_1 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_1}&date2=${timeStampDate2_1}&showDate=${date1}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_1[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_2?has_content> + <div class="label">${date2}</div> + <br/> + <#assign alt_row = false> + <#list approved_2 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_2}&date2=${timeStampDate2_2}&showDate=${date2}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_2[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_3?has_content> + <div class="label">${date3}</div> + <br/> + <#assign alt_row = false> + <#list approved_3 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_3}&date2=${timeStampDate2_3}&showDate=${date3}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_3[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_4?has_content> + <div class="label">${date4}</div> + <br/> + <#assign alt_row = false> + <#list approved_4 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_4}&date2=${timeStampDate2_4}&showDate=${date4}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_4[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_5?has_content> + <div class="label">${date5}</div> + <br/> + <#assign alt_row = false> + <#list approved_5 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_5}&date2=${timeStampDate2_5}&showDate=${date5}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_5[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_6?has_content> + <div class="label">${date6}</div> + <br/> + <#assign alt_row = false> + <#list approved_6 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_6}&date2=${timeStampDate2_6}&showDate=${date6}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_6[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_7?has_content> + <div class="label">${date7}</div> + <br/> + <#assign alt_row = false> + <#list approved_7 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_7}&date2=${timeStampDate2_7}&showDate=${date7}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_7[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_8?has_content> + <div class="label">${date8}</div> + <br/> + <#assign alt_row = false> + <#list approved_8 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_8}&date2=${timeStampDate2_8}&showDate=${date8}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_8[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_9?has_content> + <div class="label">${date9}</div> + <br/> + <#assign alt_row = false> + <#list approved_9 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_9}&date2=${timeStampDate2_9}&showDate=${date9}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_9[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_10?has_content> + <div class="label">${date10}</div> + <br/> + <#assign alt_row = false> + <#list approved_10 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_10}&date2=${timeStampDate2_10}&showDate=${date10}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_10[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_11?has_content> + <div class="label">${date11}</div> + <br/> + <#assign alt_row = false> + <#list approved_11 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_11}&date2=${timeStampDate2_11}&showDate=${date11}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_11[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_12?has_content> + <div class="label">${date12}</div> + <br/> + <#assign alt_row = false> + <#list approved_12 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_12}&date2=${timeStampDate2_12}&showDate=${date12}</@ofbizUrl>" class="test">${show.productId}</a> - ${time_12[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> + <td style="vertical-align:top;"> + <table> + <#if approved_13?has_content> + <div class="label">${date13}</div> + <br/> + <#assign alt_row = false> + <#list approved_13 as show> + <tr> + <td> + <a href="<@ofbizUrl>ListImageRecentlyApproved?productId=${show.productId}&date1=${timeStampDate1_13}&date2=${timeStampDate2_13}&showDate=${date13}</@ofbizUrl>" class="test">${show.productId}</a> - ${time13[show_index]} + </td> + </tr> + </#list> + </#if> + </table> + </td> +</table> Added: ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRotateButton.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRotateButton.ftl?rev=1052521&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRotateButton.ftl (added) +++ ofbiz/trunk/applications/product/webapp/catalog/imagemanagement/ImageRotateButton.ftl Fri Dec 24 15:22:49 2010 @@ -0,0 +1,30 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<style type="text/css"> + button.rotate-button { + margin-left : 30px; + position : relative; + top : 10px; + left : 30px; + width :auto; + height : auto; + } +</style> +<button type="button" id='rotate-left' class='rotate-button'><img src="/images/arrow-single-left-green.png"/></button> +<button type="button" id='rotate-right' class='rotate-button'><img src="/images/arrow-single-right-green.png"/></button> |
Free forum by Nabble | Edit this page |