Author: ornicar2
Date: 2010-02-03 19:28:59 +0100 (Wed, 03 Feb 2010)
New Revision: 27507

Modified:
   
plugins/diemPlugin/trunk/dmAdminPlugin/lib/action/base/dmAdminBaseGeneratedModuleActions.php
   plugins/diemPlugin/trunk/dmCorePlugin/data/dm/i18n/en_fr.yml
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Listener/Sortable.php
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Sortable.php
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmMedia.class.php
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmPage.class.php
   plugins/diemPlugin/trunk/dmFrontPlugin/lib/form/dmFormManager.php
Log:
[Diem]
- fixed possible issue when admin sort column stored in session does no more 
exist
- made table and record cache protected according dm dmMicroCache interface
- updated french translations
- fixed possible issue in PluginDmMedia and PluginDmPage when the service 
container is not available

Modified: 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/action/base/dmAdminBaseGeneratedModuleActions.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/action/base/dmAdminBaseGeneratedModuleActions.php
        2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmAdminPlugin/lib/action/base/dmAdminBaseGeneratedModuleActions.php
        2010-02-03 18:28:59 UTC (rev 27507)
@@ -58,16 +58,18 @@
    */
   protected function tryToSortWithForeignColumn(Doctrine_Query $query, array 
$sort)
   {
-    if('integer' === 
dmArray::get($this->getDmModule()->getTable()->getColumnDefinition($sort[0]), 
'type'))
+    $table = $this->getDmModule()->getTable();
+    
+    if('integer' === dmArray::get($table->getColumnDefinition($sort[0]), 
'type'))
     {
       // If the sort column is a local key, try to sort with foreign table
-      if ($relation = 
$this->getDmModule()->getTable()->getRelationHolder()->getLocalByColumnName($sort[0]))
+      if ($relation = 
$table->getRelationHolder()->getLocalByColumnName($sort[0]))
       {
         if ($relation instanceof Doctrine_Relation_LocalKey && ($foreignTable 
= $relation->getTable()) instanceof dmDoctrineTable)
         {
           if (($foreignColumn = $foreignTable->getIdentifierColumnName()) != 
'id')
           {
-            if (!$joinAlias = 
$query->getJoinAliasForRelationAlias($this->getDmModule()->getModel(), 
$relation->getAlias()))
+            if (!$joinAlias = 
$query->getJoinAliasForRelationAlias($table->getComponentName(), 
$relation->getAlias()))
             {
               $query->leftJoin(sprintf('%s.%s %s', $query->getRootAlias(), 
$relation->getAlias(), $relation->getAlias()));
               $joinAlias = $relation->getAlias();
@@ -92,14 +94,17 @@
         }
       }
     }
-    elseif($this->getDmModule()->getTable()->isI18nColumn($sort[0]))
+    elseif($table->isI18nColumn($sort[0]))
     {
-      $query->addOrderBy(sprintf('%s.%s %s', 
$query->getJoinAliasForRelationAlias($this->getDmModule()->getModel(), 
'Translation'), $sort[0], $sort[1]));
+      $query->addOrderBy(sprintf('%s.%s %s', 
$query->getJoinAliasForRelationAlias($table->getComponentName(), 
'Translation'), $sort[0], $sort[1]));
       // Success, skip default sorting by local column
       return;
     }
 
-    $query->addOrderBy($sort[0] . ' ' . $sort[1]);
+    if($table->hasField($sort[0]))
+    {
+      $query->addOrderBy($sort[0] . ' ' . $sort[1]);
+    }
   }
   
   protected function processSortForm($form)
@@ -382,7 +387,6 @@
   /*
    * List elements sorting
    */
-  
   protected function addSortQuery($query)
   {
     if (array(null, null) == ($sort = $this->getSort()))

Modified: plugins/diemPlugin/trunk/dmCorePlugin/data/dm/i18n/en_fr.yml
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/data/dm/i18n/en_fr.yml        
2010-02-03 18:23:30 UTC (rev 27506)
+++ plugins/diemPlugin/trunk/dmCorePlugin/data/dm/i18n/en_fr.yml        
2010-02-03 18:28:59 UTC (rev 27507)
@@ -250,7 +250,7 @@
 "Url Redirections": "Redirections d'urls"
 "Redirections": "Redirections"
 "Settings": "Paramètres"
-"Sent mails": "Messages envoyés"
+"Sent mails": "Courriels envoyés"
 "Errors": "Erreurs"
 "Permissions": "Autorisations"
 "Groups": "Groupes"
@@ -403,4 +403,7 @@
 "Code generation": "Génération du code"
 "%user% is browsing this page, you should not modify it now.": "%user% est 
déjà sur cette page, vous ne devriez pas la modifier maintenant."
 "or create an external link": "Ou créez un lien externe"
-"Back to the parent folder": "Retour au répertoire parent"
\ No newline at end of file
+"Back to the parent folder": "Retour au répertoire parent"
+"Email": "Courriel"
+"Website": "Site web"
+"Message": "Message"
\ No newline at end of file

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Listener/Sortable.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Listener/Sortable.php
   2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Listener/Sortable.php
   2010-02-03 18:28:59 UTC (rev 27507)
@@ -1,35 +1,5 @@
 <?php
-/*
- *  $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.phpdoctrine.org>.
- */
 
-/**
- * Doctrine_Template_Listener_Sortable
- *
- * @package     Doctrine
- * @author      Jonathan H. Wage <[email protected]>
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @category    Object Relational Mapping
- * @link        www.phpdoctrine.org
- * @since       1.2
- * @version     $Revision$
- */
 class Doctrine_Template_Listener_Sortable extends Doctrine_Record_Listener
 {
 

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Sortable.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Sortable.php
    2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/extension/Sortable/lib/Doctrine/Template/Sortable.php
    2010-02-03 18:28:59 UTC (rev 27507)
@@ -1,35 +1,5 @@
 <?php
-/*
- *  $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.phpdoctrine.org>.
- */
 
-/**
- * Doctrine_Template_Sortable
- *
- * @package     Doctrine
- * @author      Jonathan H. Wage <[email protected]>
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @category    Object Relational Mapping
- * @link        www.phpdoctrine.org
- * @since       1.2
- * @version     $Revision$
- */
 class Doctrine_Template_Sortable extends Doctrine_Template
 {
   protected $_options = array('manyListsColumn' => null);

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php  
    2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php  
    2010-02-03 18:28:59 UTC (rev 27507)
@@ -821,7 +821,7 @@
   /*
    * dmMicroCache
    */
-  private
+  protected
   $cache;
 
   protected function getCache($cacheKey)

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmMedia.class.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmMedia.class.php
    2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmMedia.class.php
    2010-02-03 18:28:59 UTC (rev 27507)
@@ -1,15 +1,5 @@
 <?php
 
-/**
- * PluginDmMedia
- *
- * This class has been auto-generated by the Doctrine ORM Framework
- *
- * @package    ##PACKAGE##
- * @subpackage ##SUBPACKAGE##
- * @author     ##NAME## <##EMAIL##>
- * @version    SVN: $Id: Builder.php 5845 2009-06-09 07:36:57Z jwage $
- */
 abstract class PluginDmMedia extends BaseDmMedia
 {
   protected
@@ -265,10 +255,12 @@
 
   public function refreshFromFile()
   {
-    $this->fromArray(array(
-      'size' => filesize($this->getFullPath()),
-      'mime' => 
$this->getServiceContainer()->getService('mime_type_resolver')->getByFilename($this->getFullPath())
-    ));
+    $this->size = filesize($this->getFullPath());
+
+    if($mimeTypeResolver = $this->getService('mime_type_resolver'))
+    {
+      $this->mime = $mimeTypeResolver->getByFilename($this->getFullPath());
+    }
     
     /*
      * Important to set dimensions without reload data

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmPage.class.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmPage.class.php 
    2010-02-03 18:23:30 UTC (rev 27506)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/PluginDmPage.class.php 
    2010-02-03 18:28:59 UTC (rev 27507)
@@ -99,7 +99,12 @@
       return $this->getCache('dm_module');
     }
 
-    return $this->setCache('dm_module', 
$this->getModuleManager()->getModuleOrNull($this->get('module')));
+    if(!$moduleManager = $this->getModuleManager())
+    {
+      return null;
+    }
+
+    return $this->setCache('dm_module', 
$moduleManager->getModuleOrNull($this->get('module')));
   }
 
   public function getPageView()
@@ -193,7 +198,7 @@
       
       $this->getPageView();
 
-      if ($this->getIsAutomatic() && !($this->getRecord() instanceof 
dmDoctrineRecord))
+      if ($this->getDmModule() && $this->getIsAutomatic() && 
!($this->getRecord() instanceof dmDoctrineRecord))
       {
         throw new dmException(sprintf(
           '%s automatic page can not be saved because it has no object for 
record_id = %s',

Modified: plugins/diemPlugin/trunk/dmFrontPlugin/lib/form/dmFormManager.php
===================================================================
--- plugins/diemPlugin/trunk/dmFrontPlugin/lib/form/dmFormManager.php   
2010-02-03 18:23:30 UTC (rev 27506)
+++ plugins/diemPlugin/trunk/dmFrontPlugin/lib/form/dmFormManager.php   
2010-02-03 18:28:59 UTC (rev 27507)
@@ -46,7 +46,7 @@
       return $form;
     }
     
-    foreach( $form->getWidgetSchema()->getFields() as $widgetKey => $widget)
+    foreach($form->getWidgetSchema()->getFields() as $widgetKey => $widget)
     {
       $widgetModel = $widget->getOption('model');
       

-- 
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