Author: jp_morvan
Date: 2010-04-13 15:30:56 +0200 (Tue, 13 Apr 2010)
New Revision: 29103

Modified:
   plugins/vjCommentPlugin/TRUNK/TODO
   
plugins/vjCommentPlugin/TRUNK/lib/form/doctrine/PluginCommentCommonForm.class.php
   plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_formComment.php
   plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/config/generator.yml
   
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/BaseCommentAdminActions.class.php
   
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminForm.class.php
   
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminReplyForm.class.php
   plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
Log:
update backend comment module for sfGuardUser


Modified: plugins/vjCommentPlugin/TRUNK/TODO
===================================================================
--- plugins/vjCommentPlugin/TRUNK/TODO  2010-04-13 13:00:11 UTC (rev 29102)
+++ plugins/vjCommentPlugin/TRUNK/TODO  2010-04-13 13:30:56 UTC (rev 29103)
@@ -6,4 +6,5 @@
 * set gravatar to call from gravatar website, OR use custom method to retrieve 
avatars. (trying to set folder outside of web/ for uploads makes it tricky to 
use gravatars).
 * Find a way to connect Comments with Commentable object through relation.
 * Listener for the routes
-* Special fields and listener for sfGuardUser and models
\ No newline at end of file
+* Special fields and listener for sfGuardUser and models
+* Add css for 'Please log in to comment'
\ No newline at end of file

Modified: 
plugins/vjCommentPlugin/TRUNK/lib/form/doctrine/PluginCommentCommonForm.class.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/lib/form/doctrine/PluginCommentCommonForm.class.php
   2010-04-13 13:00:11 UTC (rev 29102)
+++ 
plugins/vjCommentPlugin/TRUNK/lib/form/doctrine/PluginCommentCommonForm.class.php
   2010-04-13 13:30:56 UTC (rev 29103)
@@ -24,8 +24,10 @@
     $this->widgetSchema['record_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['reply'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['reply_author'] = new sfWidgetFormInputHidden();
+    $this->widgetSchema['user_name'] = new sfWidgetFormInputHidden();
     $this->validatorSchema['reply'] = new sfValidatorPass();
     $this->validatorSchema['reply_author'] = new sfValidatorPass();
+    $this->validatorSchema['user_name'] = new sfValidatorPass();
 
     $this->widgetSchema->setLabel('author_name', __('Name', array(), 
'vjComment'));
     $this->widgetSchema->setLabel('author_email', 'Email');

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_formComment.php
===================================================================
--- plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_formComment.php    
2010-04-13 13:00:11 UTC (rev 29102)
+++ plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_formComment.php    
2010-04-13 13:30:56 UTC (rev 29103)
@@ -18,6 +18,6 @@
   </fieldset>
   </form>
 <?php else: ?>
-    <?php echo __('Please log in to comment', array(), 'vjComment') ?>
+  <?php echo __('Please log in to comment', array(), 'vjComment') ?>
 <?php endif ?>
 </div>
\ No newline at end of file

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/config/generator.yml
===================================================================
--- plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/config/generator.yml     
2010-04-13 13:00:11 UTC (rev 29102)
+++ plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/config/generator.yml     
2010-04-13 13:30:56 UTC (rev 29103)
@@ -33,10 +33,10 @@
           _delete: ~
           restore:          { label: Restore }
       filter:
-        display:            [id, is_delete, record_model, author_name, 
author_email, author_website, body, created_at]
+        display:            [id, is_delete, record_model, user_id, 
author_name, author_email, author_website, body, created_at]
       form:
         display:
-          Author:           [author_name, author_email, author_website]
+          Author:           [author_name, author_email, author_website, 
user_name]
           Body:             [body]
           Edition:          [edition_reason]
         class:              commentAdminForm

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/BaseCommentAdminActions.class.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/BaseCommentAdminActions.class.php
    2010-04-13 13:00:11 UTC (rev 29102)
+++ 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/BaseCommentAdminActions.class.php
    2010-04-13 13:30:56 UTC (rev 29103)
@@ -55,7 +55,15 @@
     $this->form->setDefault('record_model', $comment->record_model);
     $this->form->setDefault('record_id', $comment->record_id);
     $this->form->setDefault('reply', $comment->id);
-    $this->form->setDefault('reply_author', $comment->author_name);
+    if($comment->user_id != null)
+    {
+      $author = $comment->getUser()->username;
+    }
+    else
+    {
+      $author = $comment->author_name;
+    }
+    $this->form->setDefault('reply_author', $author);
     $this->comment  = $this->form->getObject();
     $this->setTemplate('new');
   }

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminForm.class.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminForm.class.php
   2010-04-13 13:00:11 UTC (rev 29102)
+++ 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminForm.class.php
   2010-04-13 13:30:56 UTC (rev 29103)
@@ -15,7 +15,21 @@
     parent::configure();
     $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['updated_at'] = new sfWidgetFormInputHidden();
+    $this->widgetSchema['user_id'] = new sfWidgetFormInputHidden();
 
+    if($this->getObject()->user_id != null )
+    {
+      unset( $this['author_email'], $this['author_website'], 
$this['author_name'] );
+      $this->widgetSchema['user_name'] = new sfWidgetFormInput(array(), 
array('readonly' => 'true'));
+      $this->widgetSchema['user_name']
+        ->setLabel(__('Name', array(), 'vjComment'))
+        ->setDefault($this->getObject()->getUser()->getUsername());
+    }
+    else
+    {
+      unset( $this['user_id'] );
+    }
+
     $this->validatorSchema['edition_reason']
       ->setOption('required', true)
       ->setMessage('required', $this->required);

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminReplyForm.class.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminReplyForm.class.php
      2010-04-13 13:00:11 UTC (rev 29102)
+++ 
plugins/vjCommentPlugin/TRUNK/modules/commentAdmin/lib/commentAdminReplyForm.class.php
      2010-04-13 13:30:56 UTC (rev 29103)
@@ -14,6 +14,7 @@
   {
     parent::configure();
     unset($this['created_at'], $this['updated_at'], $this['edition_reason']);
+    
     $this->widgetSchema['reply_author'] = new sfWidgetFormInputText(array(), 
array('readonly' => "readonly"));
     $this->widgetSchema->setLabel('reply_author', __('Reply to', array(), 
'vjComment'));
   }

Modified: plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
===================================================================
--- plugins/vjCommentPlugin/TRUNK/package.xml.tmpl      2010-04-13 13:00:11 UTC 
(rev 29102)
+++ plugins/vjCommentPlugin/TRUNK/package.xml.tmpl      2010-04-13 13:30:56 UTC 
(rev 29103)
@@ -66,6 +66,8 @@
         * fizyk: integrated functionality to make use of sfGuardUser
         * fizyk: added relation to sfGuardUser
         * jp_morvan: remove report link when comment is already deleted
+        * jp_morvan: remove author name, email and website from adminComment's 
edit and reply when sfGuardUser's model used
+        * jp_morvan: add username from adminComment's edit and reply when 
sfGuardUser's model used
       </notes>
     </release>
     <release>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to