fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7399] property: fix order by in list, support fronte


From: Sigurd Nes
Subject: [Fmsystem-commits] [7399] property: fix order by in list, support frontend
Date: Sun, 19 Jun 2011 17:30:54 +0000

Revision: 7399
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7399
Author:   sigurdne
Date:     2011-06-19 17:30:54 +0000 (Sun, 19 Jun 2011)
Log Message:
-----------
property: fix order by in list, support frontend

Modified Paths:
--------------
    trunk/property/inc/class.soentity.inc.php
    trunk/property/inc/class.uientity.inc.php

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2011-06-19 17:29:42 UTC (rev 
7398)
+++ trunk/property/inc/class.soentity.inc.php   2011-06-19 17:30:54 UTC (rev 
7399)
@@ -342,9 +342,10 @@
                        $where= 'WHERE';
                        $filtermethod = '';
 
-                       $GLOBALS['phpgw']->config->read();
-                       
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_location'])
-                               && 
$GLOBALS['phpgw']->config->config_data['acl_at_location']
+                       $_config        = 
CreateObject('phpgwapi.config','property');
+                       $_config->read();
+                       if(isset($_config->config_data['acl_at_location'])
+                               && $_config->config_data['acl_at_location']
                                && $category['location_level'] > 0)
                        {
                                $access_location = 
$this->bocommon->get_location_list(PHPGW_ACL_READ);
@@ -352,6 +353,8 @@
                                $where= 'AND';
                        }
 
+                       unset($_config);
+
                        if ($filter=='all')
                        {
                                if (is_array($grants))

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2011-06-19 17:29:42 UTC (rev 
7398)
+++ trunk/property/inc/class.uientity.inc.php   2011-06-19 17:30:54 UTC (rev 
7399)
@@ -332,14 +332,19 @@
                function index()
                {
                        //redirect. If selected the title of module.
-                       if($this->entity_id == 1 && !$this->cat_id)
+                       if($this->entity_id && !$this->cat_id)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>1, 'cat_id'=> 1, 'type' => 
$this->type));
+                               $categories = 
$this->soadmin_entity->read_category(array('entity_id' => $this->entity_id));
+                               foreach($categories as $category)
+                               {
+                                       
if($this->acl->check(".{$this->type}.$this->entity_id.{$category['id']}", 
PHPGW_ACL_READ, $this->type_app[$this->type]))
+                                       {
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>$this->entity_id, 'cat_id'=> 
$category['id'], 'type' => $this->type));
+                                       }
+                               }
+                               unset($categories);
+                               unset($category);
                        }
-                       elseif($this->entity_id == 2 && !$this->cat_id)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>2, 'cat_id'=> 1, 'type' => 
$this->type));
-                       }
 
                        //redirect if no rights
                        if(!$this->acl_read && $this->cat_id)
@@ -945,6 +950,7 @@
                                        
$datatable['headers']['header'][$i]['visible']                  = true;
                                        
$datatable['headers']['header'][$i]['format']                   = 
$this->bocommon->translate_datatype_format($uicols['datatype'][$i]);
                                        
$datatable['headers']['header'][$i]['sortable']                 = 
$uicols['sortable'][$i];;
+                                       
$datatable['headers']['header'][$i]['sort_field']               = 
$uicols['name'][$i];
                                        
//$datatable['headers']['header'][$i]['formatter']              = 
$uicols['formatter'][$i];
                                        //according to stable bruch this 
columns is not SORTABLE'
                                        $denied = array('merknad');//$denied = 
array('merknad','account_lid');
@@ -952,12 +958,10 @@
                                        if(in_array ($uicols['name'][$i], 
$denied))
                                        {
                                                
$datatable['headers']['header'][$i]['sortable']         = false;
-                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
                                        }
                                        else 
if(isset($uicols['cols_return_extra'][$i]) && 
($uicols['cols_return_extra'][$i]!='T' || 
$uicols['cols_return_extra'][$i]!='CH'))
                                        {
                                                
$datatable['headers']['header'][$i]['sortable']         = true;
-                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
                                        }
 
                                }
@@ -966,7 +970,7 @@
                                        
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
                                        
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
                                        
$datatable['headers']['header'][$i]['visible']                  = false;
-                                       
$datatable['headers']['header'][$i]['sortable']          = false;
+                                       
$datatable['headers']['header'][$i]['sortable']                 = false;
                                        
$datatable['headers']['header'][$i]['format']                   = 'hidden';
                                }
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]