Author: lucaa
Date: 2008-02-05 21:12:00 +0100 (Tue, 05 Feb 2008)
New Revision: 7300

Modified:
   
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
   
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
   
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
   
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
   
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
Log:
XWATCH-13: Allow to send a press review by email
Added a checkbox to the PressReviewEmailDialog to also include articles content 
in the email.




Modified: 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
===================================================================
--- 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
 2008-02-05 16:33:27 UTC (rev 7299)
+++ 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
 2008-02-05 20:12:00 UTC (rev 7300)
@@ -461,12 +461,16 @@
     }
 
     public void sendEmail(FilterStatus filterStatus, String sendEmailPage, 
String mailSubject, 
-                          String[] mailTo, String mailContent, AsyncCallback 
cb) {
+                          String[] mailTo, String mailContent, boolean 
withArticlesContent, 
+                          AsyncCallback cb) {
         Map map = filterStatus.getMap();
         map.put("space", watch.getWatchSpace());
         map.put("address", mailTo);
         map.put("subject", mailSubject);
         map.put("content", mailContent);
+        if (withArticlesContent) {
+            map.put("withcontent", "1");
+        }
         watch.getXWikiServiceInstance().getDocumentContent(sendEmailPage, 
true, map, cb);
     }
 }

Modified: 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
===================================================================
--- 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
  2008-02-05 16:33:27 UTC (rev 7299)
+++ 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
  2008-02-05 20:12:00 UTC (rev 7300)
@@ -34,6 +34,7 @@
     protected TextBox mailSubjectTextBox;
     protected TextBox mailToTextBox;
     protected TextArea mailContentTextArea;
+    protected CheckBox articlesContentCheckBox;
     
     public PressReviewMailDialog(Watch watch, String dialogName, int 
buttonModes) {
         super(watch, dialogName, buttonModes);
@@ -86,6 +87,13 @@
         mailContentTextArea.setStyleName(getCSSName("mailcontent"));
         
mailContentTextArea.setText(app.getTranslation(getDialogTranslationName() + 
".mailcontentdefault"));
         paramsPanel.add(mailContentTextArea);
+        
+        articlesContentCheckBox = new CheckBox();
+        
articlesContentCheckBox.setText(app.getTranslation(getDialogTranslationName() 
+                                           + ".articleswithcontent"));
+        articlesContentCheckBox.setStyleName(getCSSName("withcontent"));
+        paramsPanel.add(articlesContentCheckBox);
+        
         return paramsPanel;
     }
     
@@ -104,9 +112,10 @@
             String[] emailsArray = 
this.mailToTextBox.getText().trim().split(", ");
             String mailSubject = this.mailSubjectTextBox.getText();
             String mailContent = this.mailContentTextArea.getText();
+            boolean withContent = this.articlesContentCheckBox.isChecked();
             
((Watch)app).getDataManager().sendEmail(((Watch)app).getFilterStatus(),
                     Constants.DEFAULT_CODE_SPACE + "." + 
Constants.PAGE_EMAIL_PRESSREVIEW, 
-                    mailSubject, emailsArray, mailContent, new 
XWikiAsyncCallback(app) {
+                    mailSubject, emailsArray, mailContent, withContent, new 
XWikiAsyncCallback(app) {
                 public void onSuccess(Object result) {
                     super.onSuccess(result);
                     setCurrentResult(result);

Modified: 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
===================================================================
--- 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
     2008-02-05 16:33:27 UTC (rev 7299)
+++ 
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
     2008-02-05 20:12:00 UTC (rev 7300)
@@ -693,6 +693,16 @@
        width: 380px;
        margin: 0 10px;
 }
+span.watch-email-withcontent {
+       margin: 0 10px;
+       width: 380px;
+}
+span.watch-email-withcontent label {
+       margin: 10px 0 0 10px;
+}
+span.watch-email-withcontent input {
+       margin: 10px 0 0 0;
+}
 select.gwt-ListBox
 {
        width: 380px;

Modified: 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
===================================================================
--- 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations 
    2008-02-05 16:33:27 UTC (rev 7299)
+++ 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations 
    2008-02-05 20:12:00 UTC (rev 7300)
@@ -304,6 +304,7 @@
 watch.chooseproutput.noselection=You have not selected any output
 watch.email.noaddress=There are no addresses to send email to
 watch.email.error=Press Review email sending failed due to the following 
reason:
+watch.email.articleswithcontent=Include articles content in the Press Review
 
 watch.pressreviewforspace=XWiki Watch Press Review for Space
 

Modified: 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
===================================================================
--- 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
  2008-02-05 16:33:27 UTC (rev 7299)
+++ 
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
  2008-02-05 20:12:00 UTC (rev 7300)
@@ -291,6 +291,7 @@
 watch.chooseproutput.noselection=Vous n'avez pas choisi le format de la revue 
de presse
 watch.email.noaddress=Vous n'avez renseign� aucune adresse mail
 watch.email.error=L'envoi email de la revue de presse a echou� pour la raison 
suivante:
+watch.email.articleswithcontent = Inclure le contenu des articles dans la 
revue de presse
 
 watch.pressreviewforspace=XWiki Watch Revue de Presse pour l'espace
 

_______________________________________________
notifications mailing list
notifications@xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to