phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.boentity.inc.php class.soadm...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.boentity.inc.php class.soadm...
Date: Fri, 20 Oct 2006 11:50:41 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/10/20 11:50:41

Modified files:
        inc            : class.boentity.inc.php 
                         class.soadmin_entity.inc.php 
                         class.soentity.inc.php class.uilocation.inc.php 

Log message:
        sorting for attrib in loaction / fix for selection of custom attrib in 
listing

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boentity.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soadmin_entity.inc.php?cvsroot=phpgroupware&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soentity.inc.php?cvsroot=phpgroupware&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uilocation.inc.php?cvsroot=phpgroupware&r1=1.39&r2=1.40

Patches:
Index: class.boentity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boentity.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- class.boentity.inc.php      18 Oct 2006 09:11:44 -0000      1.24
+++ class.boentity.inc.php      20 Oct 2006 11:50:40 -0000      1.25
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.boentity.inc.php,v 1.24 2006/10/18 09:11:44 
sigurdne Exp $
+       * @version $Id: class.boentity.inc.php,v 1.25 2006/10/20 11:50:40 
sigurdne Exp $
        */
 
        /**
@@ -175,7 +175,7 @@
                                
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["entity_columns_"
 . $this->entity_id . '_' . $this->cat_id];
                        }
 
-                       $columns = 
$soadmin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>$allrows));
+                       $columns = 
$soadmin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>$allrows,'filter_list'
 =>true));
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
 
                        return $column_list;

Index: class.soadmin_entity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soadmin_entity.inc.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- class.soadmin_entity.inc.php        18 Oct 2006 09:11:44 -0000      1.25
+++ class.soadmin_entity.inc.php        20 Oct 2006 11:50:40 -0000      1.26
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soadmin_entity.inc.php,v 1.25 2006/10/18 09:11:44 
sigurdne Exp $
+       * @version $Id: class.soadmin_entity.inc.php,v 1.26 2006/10/20 11:50:40 
sigurdne Exp $
        */
 
        /**
@@ -804,6 +804,7 @@
                                $allrows = 
(isset($data['allrows'])?$data['allrows']:'');
                                $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:0);
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
+                               $filter_list = 
(isset($data['filter_list'])?$data['filter_list']:'');
                        }
 
                        if ($order)
@@ -816,6 +817,10 @@
                                $ordermethod = ' order by attrib_sort asc';
                        }
 
+                       if($filter_list)
+                       {
+                               $filter_list = "AND list is NULL";
+                       } 
                        $querymethod = '';
                        if($query)
                        {
@@ -825,7 +830,7 @@
                                $querymethod = " AND (fm_entity_attribute.name 
$this->like '%$query%' or fm_entity_attribute.descr $this->like '%$query%')";
                        }
 
-                       $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id = $cat_id $querymethod";
+                       $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id = $cat_id $filter_list $querymethod";
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();

Index: class.soentity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- class.soentity.inc.php      20 Oct 2006 08:10:26 -0000      1.26
+++ class.soentity.inc.php      20 Oct 2006 11:50:40 -0000      1.27
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.soentity.inc.php,v 1.26 2006/10/20 08:10:26 
sigurdne Exp $
+       * @version $Id: class.soentity.inc.php,v 1.27 2006/10/20 11:50:40 
sigurdne Exp $
        */
 
        /**
@@ -109,6 +109,9 @@
 
                        $sql = $this->bocommon->fm_cache('sql_entity_' . 
$entity_id . '_' . $cat_id . '_' . $lookup);
 
+                       $admin_entity   = 
CreateObject($this->currentapp.'.soadmin_entity');
+                       $category = 
$admin_entity->read_single_category($entity_id,$cat_id);
+
                        $entity_table = 'fm_entity_' . $entity_id . '_' . 
$cat_id;
                        if(!$sql)
                        {
@@ -140,9 +143,6 @@
                                $uicols['descr'][]                      = 
lang('User');
                                $uicols['statustext'][]         = lang('User');
 
-                               $admin_entity   = 
CreateObject($this->currentapp.'.soadmin_entity');
-                               $category = 
$admin_entity->read_single_category($entity_id,$cat_id);
-
                                $joinmethod .= " $this->join phpgw_accounts ON 
($entity_table.user_id = phpgw_accounts.account_id))";
                                $paranthesis .='(';
 
@@ -166,26 +166,32 @@
                                $cols_return                    = 
$this->bocommon->fm_cache('cols_return_entityt_' . $entity_id . '_' . $cat_id . 
'_' . $lookup);
                                $this->cols_return_lookup       = 
$this->bocommon->fm_cache('cols_return_lookup_entityt_' . $entity_id . '_' . 
$cat_id . '_' . $lookup);
                                $this->cols_extra               = 
$this->bocommon->fm_cache('cols_extra_entityt_' . $entity_id . '_' . $cat_id . 
'_' . $lookup);
-                               if($lookup)
-                               {
-                                       $admin_entity   = 
CreateObject($this->currentapp.'.soadmin_entity');
-                                       $category = 
$admin_entity->read_single_category($entity_id,$cat_id);
-                               }
-
                        }
 
                        if ($cat_id > 0)
                        {
+                               $fm_entity_cols = 
$admin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>true));
+
+                               foreach ($fm_entity_cols as $col_entry)
+                               {
+                                       if ($col_entry['list'])
+                                       {
+                                               $result_columns[] = 
$col_entry['id'];
+                                       }
+                               }
+
                                
$user_columns=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['entity_columns_'.$entity_id.'_'.$cat_id];
-//_debug_array($user_columns);
 
                                if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
                                {
+                                       $result_columns = 
array_merge($result_columns, $user_columns);
+                                       $result_columns = 
array_unique($result_columns);
+                               }
+                                       
                                        $i      = count($uicols['name']);
-                                       foreach($user_columns as $column_id)
+                               foreach($result_columns as $column_id)
                                        {
                                                $this->db->query("SELECT * FROM 
fm_entity_attribute WHERE entity_id= $entity_id AND cat_id= $cat_id AND id= 
$column_id");
-
                                                $this->db->next_record();
                                                
                                                if($this->db->f('datatype') == 
'link')
@@ -208,7 +214,6 @@
                                                $i++;
                                        }
                                }
-                       }
                        else
                        {
                                return;

Index: class.uilocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- class.uilocation.inc.php    12 Oct 2006 09:50:40 -0000      1.39
+++ class.uilocation.inc.php    20 Oct 2006 11:50:40 -0000      1.40
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.uilocation.inc.php,v 1.39 2006/10/12 09:50:40 
sigurdne Exp $
+       * @version $Id: class.uilocation.inc.php,v 1.40 2006/10/20 11:50:40 
sigurdne Exp $
        */
 
        /**
@@ -234,7 +234,6 @@
                                }
                        }
 //_debug_array($content);
-
                        $uicols_count   = count($uicols['descr']);
                        for ($i=0;$i<$uicols_count;$i++)
                        {
@@ -243,7 +242,7 @@
                                        $table_header[$i]['header']     = 
$uicols['descr'][$i];
                                        $table_header[$i]['width']              
= '5%';
                                        $table_header[$i]['align']              
= 'center';
-                                       if($uicols['name'][$i]=='loc1')
+                                       if($uicols['name'][$i]=='loc1'):
                                        {
                                                $table_header[$i]['sort_link']  
=true;
                                                $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
@@ -263,7 +262,7 @@
                                                                                
                                                        'status'                
=> $this->status)
                                                                                
));
                                        }
-                                       if($uicols['name'][$i]=='street_name')
+                                       
elseif($uicols['name'][$i]=='street_name'):
                                        {
                                                $table_header[$i]['sort_link']  
=true;
                                                $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
@@ -283,6 +282,28 @@
                                                                                
                                                        'status'                
=> $this->status)
                                                                                
));
                                        }
+                                       
elseif(isset($uicols['cols_return_extra'][$i]) && 
($uicols['cols_return_extra'][$i]!='T' || 
$uicols['cols_return_extra'][$i]!='CH')):
+                                       {
+                                               $table_header[$i]['sort_link']  
=true;
+                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
+                                                       (
+                                                               'sort'  => 
$this->sort,
+                                                               'var'   => 
$uicols['name'][$i],
+                                                               'order' => 
$this->order,
+                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uilocation.index',
+                                                                               
                                                        'type_id'               
=> $type_id,
+                                                                               
                                                        'query'                 
=> $this->query,
+                                                                               
                                                        'district_id'           
=> $this->district_id,
+                                                                               
                                                        'part_of_town_id'       
=> $this->part_of_town_id,
+                                                                               
                                                        'lookup'                
=> $lookup,
+                                                                               
                                                        'lookup_tenant'         
=> $lookup_tenant,
+                                                                               
                                                        'lookup_name'           
=> $lookup_name,
+                                                                               
                                                        'cat_id'                
=> $this->cat_id,
+                                                                               
                                                        'status'                
=> $this->status)
+
+                                                       ));
+                                       }
+                                       endif;
                                }
                        }
 




reply via email to

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