svn commit: r607486 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties config/ProductUiLabels_it.properties webapp/catalog/WEB-INF/controller.xml webapp/catalog/reviews/pendingReviews.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r607486 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties config/ProductUiLabels_it.properties webapp/catalog/WEB-INF/controller.xml webapp/catalog/reviews/pendingReviews.ftl

mrisaliti
Author: mrisaliti
Date: Sat Dec 29 14:56:27 2007
New Revision: 607486

URL: http://svn.apache.org/viewvc?rev=607486&view=rev
Log:
Product Review forms (ftl/widgets screen) has now the same look and feel (Part of issue OFBIZ-1544).
I have also applied a modified patch from Scott Gray "Review approval system needs to work on a larger scale" (OFBIZ-20).

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/catalog/reviews/pendingReviews.ftl

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?rev=607486&r1=607485&r2=607486&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Sat Dec 29 14:56:27 2007
@@ -1221,10 +1221,14 @@
 ProductReturnable=Returnable
 ProductReturned=Returned
 PendingReviewApprove=Approve
+PendingReviewBy=Review By
+PendingReviewDate=Review Date
 PendingReviewDelete=Delete
 PendingReviewPendingApproval=Pending Approval
 ProductReviews=Reviews
 ProductReviewsPendingApproval=Reviews Pending Approval
+ProductReviewsNoPendingApproval=No Reviews Pending Approval
+PendingReviewUpdateAndApprove=Update & Approve
 ProductRollup=Rollup
 ProductRollupShort=Rollup
 ProductRollups=Rollups

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties?rev=607486&r1=607485&r2=607486&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties Sat Dec 29 14:56:27 2007
@@ -1196,10 +1196,14 @@
 ProductReturnable=Reso
 ProductReturned=Reso
 PendingReviewApprove=Approva
+PendingReviewBy=Recensito Da
+PendingReviewDate=Data Recensione
 PendingReviewDelete=Cancella
 PendingReviewPendingApproval=In Attesa di Approvazione
-ProductReviews=Recensiti
+ProductReviews=Recensioni
 ProductReviewsPendingApproval=Recensioni in Attesa di Approvazione
+ProductReviewsNoPendingApproval=Nessuna Recensione in Attesa di Approvazione
+PendingReviewUpdateAndApprove=Aggiorna e Approva
 ProductRollup=Arrivo
 ProductRollupShort=Arrivo
 ProductRollups=Arrivi

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=607486&r1=607485&r2=607486&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Sat Dec 29 14:56:27 2007
@@ -2226,7 +2226,7 @@
     <request-map uri="pendingReviews"><security https="true" auth="true"/><response name="success" type="view" value="pendingReviews"/></request-map>
     <request-map uri="updateProductReview">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="updateProductReview"/>
+        <event type="service-multi" path="" invoke="updateProductReview"/>
         <response name="success" type="view" value="pendingReviews"/>
         <response name="error" type="view" value="pendingReviews"/>
     </request-map>

Modified: ofbiz/trunk/applications/product/webapp/catalog/reviews/pendingReviews.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/reviews/pendingReviews.ftl?rev=607486&r1=607485&r2=607486&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/reviews/pendingReviews.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/reviews/pendingReviews.ftl Sat Dec 29 14:56:27 2007
@@ -16,73 +16,85 @@
 specific language governing permissions and limitations
 under the License.
 -->
-
-<h1>${uiLabelMap.ProductReviewsPendingApproval}</h1>
-<br/>
-
-<#if !pendingReviews?has_content>
-  <h3>${uiLabelMap.CommonNo} ${uiLabelMap.ProductReviewsPendingApproval}</h3>
-</#if>
-
-<#list pendingReviews as review>
-  <form name="prr_${review.productReviewId}" method="post" action="<@ofbizUrl>updateProductReview</@ofbizUrl>">
-    <input type="hidden" name="productReviewId" value="${review.productReviewId}">
-    <table border="0" cellpadding="2">
-      <#assign postedUserLogin = review.getRelatedOne("UserLogin")>
-      <#assign postedPerson = postedUserLogin.getRelatedOne("Person")>
-      <tr>
-        <td colspan="2"><hr class="sepbar"></td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.CommonPostedDate}:</div></td>
-        <td><div class="tabletext">${review.postedDateTime?if_exists}</div></td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.CommonPostedBy}:</div>
-        <td><div class="tabletext">${postedPerson.firstName} ${postedPerson.lastName}</div></td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.ProductRating}:</div>
-        <td>
-          <input type="text" name="productRating" class="textBox" size="5" value="${review.productRating?if_exists?string}">
-        </td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.CommonIsAnonymous}:</div></td>
-        <td>
-          <div class="tabletext">
-            <select name="postedAnonymous" class="selectBox">
-              <#if (((review.postedAnonymous)!"") == "Y")><option value="Y">${uiLabelMap.CommonY}</option></#if>
-              <#if (((review.postedAnonymous)!"") == "N")><option value="N">${uiLabelMap.CommonN}</option></#if>
-              <option></option>
-              <option value="N">${uiLabelMap.CommonN}</option>
-  <option value="Y">${uiLabelMap.CommonY}</option>
-            </select>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.CommonStatus}:</div></td>
-        <td>
-          <div class="tabletext">
-            <select name="statusId" class="selectBox">
-              <option value="PRR_PENDING">${uiLabelMap.PendingReviewPendingApproval}</option>
-              <option value="PRR_APPROVED">${uiLabelMap.PendingReviewApprove}</option>
-              <option value="PRR_DELETED">${uiLabelMap.PendingReviewDelete}</option>
-            </select>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td><div class="tableheadtext">${uiLabelMap.ProductReviews}:</div>
-        <td>
-          <textarea class="textAreaBox" name="productReview" rows="5" cols="40" wrap="hard">${review.productReview?if_exists}</textarea>
-        </td>
-      </tr>
-      <tr>
-        <td>&nbsp;</td>
-        <td><input type="submit" value="${uiLabelMap.CommonSave}">
-      </tr>
-    </table>
-  </form>
-</#list>
+<script language="JavaScript" type="text/javascript">
+    function changeReviewStatus(statusId) {
+        document.selectAllForm.statusId.value = statusId;
+        document.selectAllForm.submit();
+    }
+</script>
+<div class="screenlet">
+    <div class="screenlet-title-bar">
+        <h3>${uiLabelMap.ProductReviewsPendingApproval}</h3>
+    </div>
+    <div class="screenlet-body">
+        <#if !pendingReviews?has_content>
+            <h3>${uiLabelMap.ProductReviewsNoPendingApproval}</h3>
+        <#else>
+            <form method='POST' action='<@ofbizUrl>updateProductReview</@ofbizUrl>' name="selectAllForm">
+                <input type="hidden" name="_useRowSubmit" value="Y">
+                <input type="hidden" name="_checkGlobalScope" value="Y">
+                <input type="hidden" name="statusId" value="">
+                <div align="right">
+                    <input type="button" value="${uiLabelMap.CommonUpdate}" onClick="javascript:changeReviewStatus('PRR_PENDING')">
+                    <input type="button" value="${uiLabelMap.PendingReviewUpdateAndApprove}" onClick="javascript:changeReviewStatus('PRR_APPROVED')">
+                    <input type="button" value="${uiLabelMap.CommonDelete}" onClick="javascript:changeReviewStatus('PRR_DELETED')">
+                </div>
+                <table cellspacing="0" class="basic-table">
+                  <tr class="header-row">
+                    <td><b>${uiLabelMap.PendingReviewDate}</b></td>
+                    <td><b>${uiLabelMap.PendingReviewBy}</b></td>
+                    <td><b>${uiLabelMap.CommonIsAnonymous}</b></td>
+                    <td><b>${uiLabelMap.ProductProductId}</b></td>
+                    <td><b>${uiLabelMap.ProductRating}</b></td>
+                    <td><b>${uiLabelMap.CommonStatus}</b></td>
+                    <td><b>${uiLabelMap.ProductReviews}</b></td>
+                    <td align="right">
+                        <span class="label">${uiLabelMap.CommonAll}</span>
+                        <input type="checkbox" name="selectAll" value="${uiLabelMap.CommonY}" onclick="javascript:toggleAll(this, 'selectAllForm');">
+                    </td>
+                  </tr>
+                <#assign rowCount = 0>
+                <#assign rowClass = "2">
+                <#list pendingReviews as review>
+                <#assign postedUserLogin = review.getRelatedOne("UserLogin")>
+                <#assign postedPerson = postedUserLogin.getRelatedOne("Person")>
+                  <tr valign="middle"<#if rowClass == "1"> class="alternate-row"</#if>>
+                      <td>
+                          <input type="hidden" name="productReviewId_o_${rowCount}" value="${review.productReviewId}">
+                          ${review.postedDateTime?if_exists}
+                      </td>
+                      <td>${postedPerson.firstName} ${postedPerson.lastName}</td>
+                      <td>
+                          <select name='postedAnonymous_o_${rowCount}'>
+                              <option>${review.postedAnonymous?default("N")}</option>
+                              <option value="${review.postedAnonymous?default("N")}">----</option>
+                              <option value="N">${uiLabelMap.CommonN}</option>
+                              <option value="Y">${uiLabelMap.CommonY}</option>
+                          </select>
+                      </td>
+                      <td>${review.getRelatedOne("Product").internalName}<br/><a class="buttontext" href="<@ofbizUrl>EditProduct?productId=${review.productId}</@ofbizUrl>">${review.productId}</a></td>
+                      <td>
+                          <input type="text" size='3' name="productRating_o_${rowCount}" value="${review.productRating?if_exists?string}">
+                      </td>
+                      <td>${review.getRelatedOne("StatusItem").get("description", locale)}</td>
+                      <td>
+                         <textarea name="productReview_o_${rowCount}" rows="5" cols="30" wrap="hard">${review.productReview?if_exists}</textarea>
+                      </td>
+                      <td align="right">
+                        <input type="checkbox" name="_rowSubmit_o_${rowCount}" value="Y" onclick="javascript:checkToggle(this, 'selectAllForm');">
+                      </td>
+                  </tr>
+                <#assign rowCount = rowCount + 1>
+                <#-- toggle the row color -->
+                <#if rowClass == "2">
+                    <#assign rowClass = "1">
+                <#else>
+                    <#assign rowClass = "2">
+                </#if>
+                </#list>
+                <input type="hidden" name="_rowCount" value="${rowCount}">
+                </table>
+            </form>
+        </#if>
+    </div>
+</div>
\ No newline at end of file