fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10359] property: attribute groups within attribute g


From: Sigurd Nes
Subject: [Fmsystem-commits] [10359] property: attribute groups within attribute groups
Date: Sun, 28 Oct 2012 16:36:50 +0000

Revision: 10359
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10359
Author:   sigurdne
Date:     2012-10-28 16:36:50 +0000 (Sun, 28 Oct 2012)
Log Message:
-----------
property: attribute groups within attribute groups

Modified Paths:
--------------
    trunk/property/inc/class.boadmin_entity.inc.php
    trunk/property/inc/class.soadmin_entity.inc.php
    trunk/property/inc/class.uiadmin_entity.inc.php

Modified: trunk/property/inc/class.boadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_entity.inc.php     2012-10-28 16:34:24 UTC 
(rev 10358)
+++ trunk/property/inc/class.boadmin_entity.inc.php     2012-10-28 16:36:50 UTC 
(rev 10359)
@@ -120,7 +120,7 @@
                        $this->type                      = isset( $type ) && 
$type && isset( $this->type_app[$type] ) ? $type : 'entity';
                        $this->cat_id            = isset( $cat_id ) && $cat_id 
? $cat_id : '';
                        $this->entity_id         = isset( $entity_id ) && 
$entity_id ? $entity_id : '';
-                       $this->allrows           = isset( $allrows ) && 
$allrows ? $allrows : '';
+                       $this->allrows           = phpgw::get_var( 'allrows', 
'bool' );
                        $this->so                        = CreateObject( 
'property.soadmin_entity', '', '',
                                                                $this->bocommon 
);
                        $this->so->type          = $this->type;

Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php     2012-10-28 16:34:24 UTC 
(rev 10358)
+++ trunk/property/inc/class.soadmin_entity.inc.php     2012-10-28 16:36:50 UTC 
(rev 10359)
@@ -209,25 +209,15 @@
                }
 
 
-               function get_children2($entity_id, $parent, $level, $reset = 
false, $table)
+               function get_children2($entity_id, $parent, $level, $reset = 
false)
                {
                        if($reset)
                        {
                                $this->category_tree = array();
                        }
-
-                       if(!$table)
-                       {
-                               $table = "fm_{$this->type}_category";
-                               $filtermethod = 'WHERE entity_id =' . (int)$id;
-                       }
-                       else
-                       {
-                               $filtermethod = 'WHERE location_id =' . 
(int)$id;                       
-                       }
-
                        $db = clone($this->db);
-                       $sql = "SELECT * FROM {$table} $filtermethod AND 
parent_id = {$parent} ORDER BY name ASC";
+                       $table = "fm_{$this->type}_category";
+                       $sql = "SELECT * FROM {$table} WHERE entity_id = 
{$entity_id} AND parent_id = {$parent} ORDER BY name ASC";
                        $db->query($sql,__LINE__,__FILE__);
 
                        while ($db->next_record())
@@ -244,19 +234,11 @@
                        return $this->category_tree;
                } 
 
-               public function read_category_tree2($id, $table = '')
+               public function read_category_tree2($entity_id)
                {
-                       if(!$table)
-                       {
-                               $table = "fm_{$this->type}_category";
-                               $filtermethod = 'WHERE entity_id =' . (int)$id;
-                       }
-                       else
-                       {
-                               $filtermethod = 'WHERE location_id =' . 
(int)$id;                       
-                       }
+                       $table = "fm_{$this->type}_category";
 
-                       $sql = "SELECT * FROM $table $filtermethod AND 
(parent_id = 0 OR parent_id IS NULL) ORDER BY name ASC";
+                       $sql = "SELECT * FROM $table WHERE entity_id=$entity_id 
AND (parent_id = 0 OR parent_id IS NULL) ORDER BY name ASC";
 
                        $this->db->query($sql,__LINE__,__FILE__);
 
@@ -279,7 +261,7 @@
                                                'id'    => $category['id'],
                                                'name'  => $category['name']
                                        );
-                               $this->get_children2($id, $category['id'], 1, 
false, $table);
+                               $this->get_children2($entity_id, 
$category['id'], 1);
                        }
                        return $this->category_tree;
                }

Modified: trunk/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_entity.inc.php     2012-10-28 16:34:24 UTC 
(rev 10358)
+++ trunk/property/inc/class.uiadmin_entity.inc.php     2012-10-28 16:36:50 UTC 
(rev 10359)
@@ -96,7 +96,6 @@
                                        'query'         => $this->query,
                                        'sort'          => $this->sort,
                                        'order'         => $this->order,
-                                       'allrows'       => $this->allrows,
                                        'entity_id'     => $this->entity_id,
                                        'cat_id'        => $this->cat_id
                                );
@@ -1444,7 +1443,7 @@
                                //                              $dry_run = true;
                        }
 
-                       $attrib_list = 
$this->bo->read_attrib_group($entity_id,$cat_id);
+                       $attrib_list = 
$this->bo->read_attrib_group($entity_id,$cat_id, phpgw::get_var( 'allrows', 
'bool' ));
                        $uicols['name'][0]      = 'id';
                        $uicols['descr'][0]     = lang('id');
                        $uicols['name'][1]      = 'parent_id';
@@ -1453,7 +1452,7 @@
                        $uicols['descr'][2]     = lang('Name');
                        $uicols['name'][3]      = 'descr';
                        $uicols['descr'][3]     = lang('Descr');
-                       $uicols['name'][4]      = 'group_sort';
+                       $uicols['name'][4]      = 'group_sort_text';
                        $uicols['descr'][4]     = lang('sorting');
                        $uicols['name'][5]      = 'up';
                        $uicols['descr'][5]     = lang('up');
@@ -2196,12 +2195,16 @@
 
 
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}");
-                       $parent_list = 
$this->bocommon->select_list($values['parent_id'], 
$this->bo->read_category_tree2($location_id, 'phpgw_cust_attribute_group'));
 
+                       $parent_list = 
$GLOBALS['phpgw']->custom_fields->find_group( 
$this->type_app[$this->type],".{$this->type}.{$entity_id}.{$cat_id}", 0, '',    
   '', '', true );
+                       
+                       $parent_list = 
$this->bocommon->select_list($values['parent_id'],$parent_list);
+//_debug_array($parent_list);die();
+
                        if($id)
                        {
                                $exclude = array($id);
-                               $children = 
$this->bo->get_children2($location_id, $id, 0,true, 
'phpgw_cust_attribute_group');
+                               $children =  
$GLOBALS['phpgw']->custom_fields->get_attribute_group_children($location_id, 
$id,0, 0, true);
 
                                foreach($children as $child)
                                {




reply via email to

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