Author: jp_morvan
Date: 2010-04-13 14:26:54 +0200 (Tue, 13 Apr 2010)
New Revision: 29101

Modified:
   
plugins/vjCommentPlugin/TRUNK/lib/doctrine/extension/Commentable/Template/Commentable.php
   plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_comment_infos.php
   plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
Log:
- remove report link when comment is already deleted
- correct a bug in getCommentsQuery() in the template


Modified: 
plugins/vjCommentPlugin/TRUNK/lib/doctrine/extension/Commentable/Template/Commentable.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/lib/doctrine/extension/Commentable/Template/Commentable.php
   2010-04-13 11:03:44 UTC (rev 29100)
+++ 
plugins/vjCommentPlugin/TRUNK/lib/doctrine/extension/Commentable/Template/Commentable.php
   2010-04-13 12:26:54 UTC (rev 29101)
@@ -34,11 +34,14 @@
   public function getCommentsQuery()
   {
     $query = Doctrine::getTable('Comment')->createQuery('c')
-    ->leftJoin( 'c.User as u')
-    ->where('c.record_id = ?', $this->_invoker->get('id'))
-    ->andWhere('c.record_model = ?', 
$this->_invoker->getTable()->getComponentName())
-    ->orderBy('c.created_at ASC');
+      ->where('c.record_id = ?', $this->_invoker->get('id'))
+      ->andWhere('c.record_model = ?', 
$this->_invoker->getTable()->getComponentName())
+      ->orderBy('c.created_at ASC');
 
+    if(sfConfig::get( 'app_vjCommentPlugin_guardbind', false ))
+    {
+      $query->leftJoin( 'c.User as u');
+    }
     return $query;
   }
 }
\ No newline at end of file

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_comment_infos.php
===================================================================
--- plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_comment_infos.php  
2010-04-13 11:03:44 UTC (rev 29100)
+++ plugins/vjCommentPlugin/TRUNK/modules/comment/templates/_comment_infos.php  
2010-04-13 12:26:54 UTC (rev 29101)
@@ -5,14 +5,14 @@
                   image_tag('/vjCommentPlugin/images/comments.png') ,
                   "reply('".$obj->id."','".$obj->author_name."')",
                   array('title' => __('Reply to this comment', array(), 
'vjComment'))) ?>
-        <?php endif; ?>
-        <?php echo link_to_function(
+          <?php echo link_to_function(
                 image_tag('/vjCommentPlugin/images/error.png') ,
                 'window.open(
                   \''.url_for('@commentReport?id='.$obj->id.'&num='.$i).'\',
                   \''.__('Add new comment', array(), 'vjComment').'\',
                     "menubar=no, status=no, scrollbars=no, menubar=no, 
width=565, height=300")',
                 array('target' => '_blank', 'title' => __('Report this comment 
- New window', array(), 'vjComment'), 'id' => 'opener')) ?><br />
+        <?php endif; ?>
         <?php if(commentTools::isGravatarAvailable() && !$obj->is_delete): ?>
           <?php echo gravatar_image_tag($obj->getAuthorEmail()) ?>
         <?php endif ?>

Modified: plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
===================================================================
--- plugins/vjCommentPlugin/TRUNK/package.xml.tmpl      2010-04-13 11:03:44 UTC 
(rev 29100)
+++ plugins/vjCommentPlugin/TRUNK/package.xml.tmpl      2010-04-13 12:26:54 UTC 
(rev 29101)
@@ -65,6 +65,7 @@
         * fizyk: added setting that allows adding relation bewteen comment and 
sfGuardUser, so it will no longer be mandatory to use sfGuardUser.
         * fizyk: integrated functionality to make use of sfGuardUser
         * fizyk: added relation to sfGuardUser
+        * jp_morvan: remove report link when comment is already deleted
       </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