Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module
In directory 
james.mmbase.org:/tmp/cvs-serv23236/portlets-newsletter/src/webapp/editors/newsletter/module

Modified Files:
        report_newsletter_subscriptions.jsp 
        report_subscriber_subscriptions.jsp report_overview.jsp 
        report_newsletter_list.jsp report_subscriber_list.jsp 
Added Files:
        import.jsp 
Log Message:
CMSC-888 fix.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module
See also: http://www.mmbase.org/jira/browse/CMSC-888


import.jsp is new



Index: report_newsletter_subscriptions.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module/report_newsletter_subscriptions.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- report_newsletter_subscriptions.jsp 5 May 2008 02:40:11 -0000       1.3
+++ report_newsletter_subscriptions.jsp 7 May 2008 02:54:39 -0000       1.4
@@ -18,16 +18,22 @@
    </div>
 </div>
 <div class="editor">
-   <c:if test="${fn:length(results) gt pagesize || not empty 
param.query_parameter_name || not empty param.query_parameter_email }">
+   <c:if test="${fn:length(results) gt pagesize || not empty param.name || not 
empty param.email }">
    <div class="body">
       <form method="POST" name="form" action="SubscriptionManagement.do">
-         <input type="hidden" name="action" value="newsletterDetail"/>
-         <table border="0">
+         <input type="hidden" name="action" value="listSubscription"/>
+         <input type="hidden" name="newsletterId" 
value="${param.newsletterId}"/>
+         <table>
+            <tr>
+               <td style="width: 150px"><fmt:message 
key="subscriptiondetail.fullname"/></td>
+               <td>
+                  <input type="text" name="name" value="${param.name}" 
style="width: 250px"/>
+               </td>
+            </tr>
             <tr>
-               <td style="width: 150px">Title</td>
+               <td style="width: 150px"><fmt:message 
key="subscriptiondetail.emailaddress"/></td>
                <td>
-                  <input type="text" name="query_parameter_name" 
value="${param.query_parameter_name}"
-                         style="width: 250px"/>
+                  <input type="text" name="email" value="${param.email}" 
style="width: 250px"/>
                </td>
             </tr>
             <tr>
@@ -44,18 +50,20 @@
       </div>
       </c:if>
       <div class="body">
-         <form method="POST" name="operationform" 
action="SubscriptionManagement.do">
-            <input type="hidden" name="action" value="exportSusbscriptions"/>
+         <form method="POST" name="operationform" 
action="SubscriptionImportExportAction.do">
+            <input type="hidden" name="action" value="export"/>
             <input type="hidden" name="type" value="subscription"/>
             <pg:pager maxPageItems="${pagesize}" 
url="SubscriptionManagement.do">
-               <pg:param name="action" value="newsletterOverview"/>
-               <pg:param name="query_parameter_title" 
value="${param.query_parameter_title}"/>
+               <pg:param name="action" value="listSubscription"/>
+               <pg:param name="name" value="${param.name}"/>
+               <pg:param name="name" value="${param.name}"/>
+               <pg:param name="newsletterId" value="${param.newsletterId}"/>
                <table>
                   <thead>
                      <th></th>
-                     <th>user name</th>
-                     <th>full name</th>
-                     <th>email</th>
+                     <th><fmt:message 
key="subscriptionoverview.username"/></th>
+                     <th><fmt:message key="subscriptiondetail.fullname"/></th>
+                     <th><fmt:message 
key="subscriptiondetail.emailaddress"/></th>
                   </thead>
                   <tbody>
                         <[EMAIL PROTECTED] id="results" 
type="java.util.List"--%>
@@ -63,7 +71,9 @@
                         <pg:item>
                            <tr>
                               <td><input type="checkbox" name="subscriptionId" 
value="${result.id}"/></td>
-                              <td>${result.username}</td>
+                              <td>
+                                    ${result.email}
+                              </td>
                               <td>${result.fullname}</td>
                               <td>${result.email}</td>
                            </tr>
@@ -73,18 +83,36 @@
                </table>
                <%@ include file="pager_index.jsp" %>
             </pg:pager>
-
-            <ul>
-               <li>
-                  <input type="submit" name="submitButton"
-                         onclick="document.forms['operationform'].submit()"
-                         value="Export subscriptions"/>
-               </li>
-            </ul>
+            <br/>
+            <input type="button" name="submitButton" class="submit"
+                   onclick="exportsubscription()"
+                   value="<fmt:message 
key="subscriptiondetail.link.exportselect"/>"/>
          </form>
       </div>
 
    </div>
 </div>
 
+<script>
+   function exportsubscription() {
+      var subscriptions = document.getElementsByName('subscriptionId');
+      var hasSelection = false;
+      for (var i = 0; i < subscriptions.length; i ++) {
+         if (subscriptions[i].checked) {
+            hasSelection = true;
+            break;
+         }
+      }
+
+      if (hasSelection) {
+         document.forms['operationform'].submit();
+      }
+      else {
+         alert("You have to select at least one item");
+      }
+
+      return false;
+   }
+</script>
+
 


Index: report_subscriber_subscriptions.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module/report_subscriber_subscriptions.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- report_subscriber_subscriptions.jsp 21 Jan 2008 12:27:49 -0000      1.3
+++ report_subscriber_subscriptions.jsp 7 May 2008 02:54:39 -0000       1.4
@@ -1,67 +1,86 @@
 <[EMAIL PROTECTED] file="globals.jsp" %>
 
-<cmscedit:head title="reactions.title">
-       <fmt:message key="subscriptiondetail.title" />
-</cmscedit:head>
-
-<br><br>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
+<%@ taglib uri="http://finalist.com/cmsc"; prefix="cmsc" %>
+<%@ taglib uri="http://jsptags.com/tags/navigation/pager"; prefix="pg" %>
 
-<jsp:useBean id="subscriptionDetailBean" scope="request" 
class="com.finalist.newsletter.module.bean.SubscriptionDetailBean" />
-<c:set var="userName" value="${subscriptionDetailBean.userName}" />
+<cmscedit:head title="ewsletter.subscription.manage.newsletteroverview">
+</cmscedit:head>
 
-<mm:cloud>
-<table width="50%">
+<div class="tabs">
+   <div class="tab_active">
+      <div class="body">
+         <div>
+            <a href="#"><fmt:message key="newsletteroverview.title"/></a>
+         </div>
+      </div>
+   </div>
+</div>
+<div class="editor">
+   <c:if test="${fn:length(results) gt pagesize || not empty param.title }">
+   <div class="body">
+      <form method="POST" name="form" action="SubscriptionManagement.do">
+         <input type="hidden" name="action" value="newsletterOverview"/>
+         <table border="0">
        <tr>
-               <th align="left"><fmt:message key="subscriptiondetail.username" 
/></tk>
-               <td><jsp:getProperty name="subscriptionDetailBean" 
property="userName" /></td>
+               <td style="width: 150px">Title</td>
+               <td><input type="text" name="title" value="${param.title}" 
style="width: 250px"/></td>
        </tr>
        <tr>
-               <th align="left"><fmt:message 
key="subscriptiondetail.emailaddress" /></tk>
-               <td><jsp:getProperty name="subscriptionDetailBean" 
property="emailAddress" /></td>
+               <td colspan="2">
+                  <input type="submit" name="submitButton" 
onclick="document.forms['form'].submit()" value="Search"/>
+               </td>
        </tr>
+         </table>
+      </form>
+
+      <div class="ruler_green">
+         <div><fmt:message key="newsletteroverview.title"/></div>
+      </div>
+      </c:if>
+
+      <div class="body">
+         <c:choose>
+            <c:when test="${fn:length(results) gt 0}">
+               <form method="POST" name="operationform" 
action="SubscriptionManagement.do">
+                  <input type="hidden" name="action" id="action"/>
+                  <pg:pager maxPageItems="${pagesize}" 
url="SubscriptionManagement.do">
+                     <pg:param name="action" value="newsletterOverview"/>
+                     <pg:param name="query_parameter_title" 
value="${param.query_parameter_title}"/>
+                     <table>
+                        <thead>
+                           <th></th>
+                           <th><fmt:message 
key="newsletteroverview.newsletter"/></th>
+                           <th><fmt:message 
key="globalstats.total.publications"/></th>
+                        </thead>
+                        <tbody>
+                              <[EMAIL PROTECTED] id="results" 
type="java.util.List"--%>
+                           <c:forEach items="${results}" var="result">
+                              <pg:item>
        <tr>
-               <th align="left"><fmt:message key="subscriptiondetail.status" 
/></tk>
+                                    <td><input type="checkbox" 
name="newsletterIds" value="${result.id}"/></td>
                <td>
-                       <cmsc:select var="mimetype">
-                               <c:forEach var="m" 
items="${bean.availableMimeTypes}">
-                                       <cmsc:option name="${m}" value="${m}" />
-                               </c:forEach>
-                       </cmsc:select>
+                                          ${result.newsletter}
                </td>
+                                    <td>${result.status}</td>
        </tr>
-       <tr>
-               <th align="left"><fmt:message key="subscriptiondetail.mimetype" 
/></tk>
-               <td>
-                       <cmsc:select var="status">
-                               <c:forEach var="s" 
items="${bean.availableStatusOptions}">
-                                       <cmsc:option name="${s}" value="${s}" />
+                              </pg:item>
                                </c:forEach>
-                       </cmsc:select>
-               </td>
+                        </tbody>
+                     </table>
+                     <%@ include file="pager_index.jsp" %>
+                     <br>
+                  </pg:pager>
+               </form>
+            </c:when>
+            <c:otherwise>
+               <fmt:message key="error.no_items"/>
+            </c:otherwise>
+         </c:choose>
+      </div>
+
+   </div>
+</div>
+
 
-       </tr>
-</table>
-<br><br>
-<table width="75%">
-       <mm:listnodes type="newsletter">
-       <mm:field name="number" jspvar="newsletternumber" write="false" />
-               <tr>
-                       <td width="10px"><cmsc:checkbox 
var="newslettersubscriptions" value="${newsletternumber}" />
-                       <td colspan="2"><mm:field name="title" write="true" />  
</td>
-               </tr>           
-               <mm:relatednodes type="newslettertheme" role="newslettertheme">
-               <mm:field name="number" jspvar="themenumber" write="false" />
-               <tr><td>&nbsp;</td>
-                       <td width="10px"><cmsc:checkbox 
var="themesubscriptions" value="${themenumber}" />
-                       <td><mm:field name="title" write="true" />      </td>
-               </tr>
-               </mm:relatednodes>
-       </mm:listnodes>
-</table>
-</mm:cloud>
-
-<br /><a 
href="SubscriptionAction.do?action=update&username=${userName}"><fmt:message 
key="subscriptiondetail.link.update" /></a>
-<br /><a 
href="SubscriptionAction.do?action=pause&username=${userName}"><fmt:message 
key="subscriptiondetail.link.pause" /></a>
-<br /><a 
href="SubscriptionAction.do?action=resume&username=${userName}"><fmt:message 
key="subscriptiondetail.link.resume" /></a>
-<br /><a 
href="SubscriptionAction.do?action=unsubscribe&username=${userName}"><fmt:message
 key="subscriptiondetail.link.unsubscribe" /></a>
-<br /><a 
href="SubscriptionAction.do?action=terminate&username=${userName}"><fmt:message 
key="subscriptiondetail.link.terminate" /></a>
\ No newline at end of file


Index: report_overview.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module/report_overview.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- report_overview.jsp 5 May 2008 02:40:11 -0000       1.2
+++ report_overview.jsp 7 May 2008 02:54:39 -0000       1.3
@@ -32,27 +32,27 @@
             <td>${requestScope.subscriptioncount}</td>
          </tr>
       </table>
-
-      <br/>
-
       <div>
          <p>
             <a href="SubscriptionManagement.do?action=newsletterOverview">
                <fmt:message key="index.link.newsletteroverview"/>
             </a>
          </p>
+
          <p>
-            <a href="SubscriptionManagement.do?action=subscriberOverview">
+            <a href="SubscriptionManagement.do?action=listSubscribers">
                <fmt:message key="index.link.subscriptionoverview"/>
             </a>
          </p>
+
          <p>
-            <a href="SubscriptionManagement.do?action=exportSusbscriptions">
+            <a href="SubscriptionImportExportAction.do?action=export">
                <fmt:message key="index.link.exportall"/>
             </a>
          </p>
+
          <p>
-            <a href="SubscriptionManagement.do?action=import">
+            <a href="SubscriptionManagement.do?action=showImportPage">
                <fmt:message key="index.link.import"/>
             </a>
          </p>


Index: report_newsletter_list.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module/report_newsletter_list.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- report_newsletter_list.jsp  5 May 2008 02:40:11 -0000       1.2
+++ report_newsletter_list.jsp  7 May 2008 02:54:39 -0000       1.3
@@ -5,56 +5,56 @@
 <%@ taglib uri="http://finalist.com/cmsc"; prefix="cmsc" %>
 <%@ taglib uri="http://jsptags.com/tags/navigation/pager"; prefix="pg" %>
 
-<cmscedit:head title="reactions.title">
+<cmscedit:head title="ewsletter.subscription.manage.newsletteroverview">
 </cmscedit:head>
 
 <div class="tabs">
    <div class="tab_active">
       <div class="body">
          <div>
-            <a href="#"><fmt:message 
key="newsletter.subscription.manage.newsletteroverview"/></a>
+            <a href="#"><fmt:message key="newsletteroverview.title"/></a>
          </div>
       </div>
    </div>
 </div>
 <div class="editor">
-   <c:if test="${fn:length(results) gt pagesize || not empty 
param.query_parameter_title }">
+   <c:if test="${fn:length(results) gt pagesize || not empty param.title }">
    <div class="body">
       <form method="POST" name="form" action="SubscriptionManagement.do">
          <input type="hidden" name="action" value="newsletterOverview"/>
          <table border="0">
             <tr>
                <td style="width: 150px">Title</td>
-               <td><input type="text" name="query_parameter_title" 
value="${param.query_parameter_title}"
-                          style="width: 250px"/></td>
+               <td><input type="text" name="title" value="${param.title}" 
style="width: 250px"/></td>
             </tr>
             <tr>
                <td colspan="2">
-                  <input type="submit" name="submitButton"
-                         onclick="document.forms['form'].submit()" 
value="Search"/>
+                  <input type="submit" name="submitButton" 
onclick="document.forms['form'].submit()" value="Search"/>
                </td>
             </tr>
          </table>
       </form>
 
       <div class="ruler_green">
-         <div>Reactions found</div>
+         <div><fmt:message key="newsletteroverview.title"/></div>
       </div>
       </c:if>
+
       <div class="body">
+         <c:choose>
+            <c:when test="${fn:length(results) gt 0}">
          <form method="POST" name="operationform" 
action="SubscriptionManagement.do">
             <input type="hidden" name="action" id="action"/>
-            <input type="hidden" name="type" id="type" value="newsletter"/>
             <pg:pager maxPageItems="${pagesize}" 
url="SubscriptionManagement.do">
                <pg:param name="action" value="newsletterOverview"/>
                <pg:param name="query_parameter_title" 
value="${param.query_parameter_title}"/>
                <table>
                   <thead>
                      <th></th>
-                     <th>title</th>
-                     <th>number of publications</th>
-                     <th>sent publications</th>
-                     <th>number of subscriptions</th>
+                           <th><fmt:message 
key="newsletteroverview.newsletter"/></th>
+                           <th><fmt:message 
key="globalstats.total.publications"/></th>
+                           <th><fmt:message 
key="globalstats.total.sentsubscriptions"/></th>
+                           <th><fmt:message 
key="globalstats.total.subscriptions"/></th>
                   </thead>
                   <tbody>
                         <[EMAIL PROTECTED] id="results" 
type="java.util.List"--%>
@@ -62,7 +62,11 @@
                         <pg:item>
                            <tr>
                               <td><input type="checkbox" name="newsletterIds" 
value="${result.id}"/></td>
-                              <td><a 
href="SubscriptionManagement.do?action=newsletterDetail&nesletterId=${result.id}">${result.title}</a></td>
+                                    <td>
+                                       <a 
href="SubscriptionManagement.do?action=listSubscription&newsletterId=${result.id}">
+                                             ${result.title}
+                                       </a>
+                                    </td>
                               <td>${result.countpublications}</td>
                               <td>${result.countSentPublicatons}</td>
                               <td>${result.countSubscriptions}</td>
@@ -72,19 +76,20 @@
                   </tbody>
                </table>
                <%@ include file="pager_index.jsp" %>
+                     <br>
             </pg:pager>
-
-            <ul>
-               <li>
                   <input type="submit" name="submitButton"
                          
onclick="document.getElementById('action').value='exportSusbscriptions';document.forms['operationform'].submit()"
-                         value="Export subscriptions"/>
-               </li>
-               <li>
-                  <a href="#">Unsubscribe selected subscriptions</a>
-               </li>
-            </ul>
+                         value="<fmt:message 
key="subscriptiondetail.link.exportselect"/>"/>
+                  <input type="submit" name="submitButton"
+                         
onclick="document.getElementById('action').value='exportSusbscriptions';document.forms['operationform'].submit()"
+                         value="<fmt:message 
key="globalstats.total.unsubscribeselect"/>"/>
          </form>
+            </c:when>
+            <c:otherwise>
+               <fmt:message key="error.no_items"/>
+            </c:otherwise>
+         </c:choose>
       </div>
 
    </div>


Index: report_subscriber_list.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/module/report_subscriber_list.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- report_subscriber_list.jsp  20 Jan 2008 22:48:35 -0000      1.2
+++ report_subscriber_list.jsp  7 May 2008 02:54:39 -0000       1.3
@@ -1,27 +1,118 @@
 <[EMAIL PROTECTED] file="globals.jsp" %>
 
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
+<%@ taglib uri="http://finalist.com/cmsc"; prefix="cmsc" %>
+<%@ taglib uri="http://jsptags.com/tags/navigation/pager"; prefix="pg" %>
+
 <cmscedit:head title="reactions.title">
-       <fmt:message key="subscriptionoverview.title" />
 </cmscedit:head>
 
-<br><br>
-
-<table width="50%">
+<div class="tabs">
+   <div class="tab_active">
+      <div class="body">
+         <div>
+            <a href="#"><fmt:message key="newsletterdetail.title"/></a>
+         </div>
+      </div>
+   </div>
+</div>
+<div class="editor">
+   <c:if test="${fn:length(results) gt pagesize || not empty param.name || not 
empty param.email }">
+   <div class="body">
+      <form method="POST" name="form" action="SubscriptionManagement.do">
+         <input type="hidden" name="action" value="listSubscribers"/>
+         <table>
+            <tr>
+               <td style="width: 150px"><fmt:message 
key="subscriptiondetail.fullname"/></td>
+               <td>
+                  <input type="text" name="name" value="${param.name}" 
style="width: 250px"/>
+               </td>
+            </tr>
        <tr>
-               <th align="left"><fmt:message 
key="subscriptionoverview.username" /></tk>
-               <th align="left"><fmt:message key="subscriptionoverview.status" 
/></tk>
-               <th align="left"><fmt:message 
key="subscriptionoverview.mimetype" /></tk>
-               <th align="left"><fmt:message 
key="subscriptionoverview.numberofnewsletters" /></tk>
-               <th align="left"><fmt:message 
key="subscriptionoverview.numberofthemes" /></tk>
+               <td style="width: 150px"><fmt:message 
key="subscriptiondetail.emailaddress"/></td>
+               <td>
+                  <input type="text" name="email" value="${param.email}" 
style="width: 250px"/>
+               </td>
        </tr>
-       <c:forEach var="bean" items="${subscriptionoverviewBeans}">
-       <c:url var="url" 
value="ReportSubscriberSubscriptions.do?name=${bean.userName}" />
        <tr>
-               <td><a href="${url}"><jsp:getProperty name="bean" 
property="userName" /></a></td>
-               <td><jsp:getProperty name="bean" property="status" /></td>
-               <td><jsp:getProperty name="bean" property="mimeType" /></td>
-               <td><jsp:getProperty name="bean" property="numberOfNewsletters" 
/></td>
-               <td><jsp:getProperty name="bean" property="numberOfThemes" 
/></td>
+               <td colspan="2">
+                  <input type="submit" name="submitButton"
+                         onclick="document.forms['form'].submit()" 
value="Search"/>
+               </td>
+            </tr>
+         </table>
+      </form>
+
+      <div class="ruler_green">
+         <div>Reactions found</div>
+      </div>
+      </c:if>
+      <div class="body">
+         <form method="POST" name="operationform" 
action="SubscriptionImportExportAction.do">
+            <input type="hidden" name="action" value="export"/>
+            <input type="hidden" name="type" value="person"/>
+            <pg:pager maxPageItems="${pagesize}" 
url="SubscriptionManagement.do">
+               <pg:param name="action" value="listSubscribers"/>
+               <pg:param name="name" value="${param.name}"/>
+               <pg:param name="email" value="${param.email}"/>
+               <table>
+                  <thead>
+                     <th></th>
+                     <th><fmt:message 
key="subscriptionoverview.username"/></th>
+                     <th><fmt:message key="subscriptiondetail.fullname"/></th>
+                     <th><fmt:message 
key="subscriptiondetail.emailaddress"/></th>
+                  </thead>
+                  <tbody>
+                        <[EMAIL PROTECTED] id="results" 
type="java.util.List"--%>
+                     <c:forEach items="${results}" var="result">
+                        <pg:item>
+                           <tr>
+                              <td><input type="checkbox" name="userId" 
value="${result.id}"/></td>
+                              <td>
+                                 <a 
href="SubscriptionManagement.do?action=listSubscriptionByPerson&subsriberId=${result.id}">
+                                       ${result.email}
+                                 </a>
+                              </td>
+                              <td>${result.fullname}</td>
+                              <td>${result.email}</td>
        </tr>
+                        </pg:item>
        </c:forEach>
-</table>
\ No newline at end of file
+                  </tbody>
+               </table>
+               <%@ include file="pager_index.jsp" %>
+            </pg:pager>
+            <br/>
+            <input type="button" name="submitButton" class="submit"
+                   onclick="exportsubscription()"
+                   value="<fmt:message 
key="subscriptiondetail.link.exportselect"/>"/>
+         </form>
+      </div>
+
+   </div>
+</div>
+
+<script>
+   function exportsubscription() {
+      var subscriptions = document.getElementsByName('userId');
+      var hasSelection = false;
+      for (var i = 0; i < subscriptions.length; i ++) {
+         if (subscriptions[i].checked) {
+            hasSelection = true;
+            break;
+         }
+      }
+
+      if (hasSelection) {
+         document.forms['operationform'].submit();
+      }
+      else {
+         alert("You have to select at least one item");
+      }
+
+      return false;
+   }
+</script>
+
+
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to