phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.custom_fields.inc.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] phpgwapi/inc class.custom_fields.inc.php
Date: Mon, 09 Oct 2006 13:26:55 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Changes by:     Sigurd Nes <sigurdne>   06/10/09 13:26:55

Modified files:
        inc            : class.custom_fields.inc.php 

Log message:
        merging admin/inc/class.so_custom.inc.php and 
phpgwapi/inc/class.custom_fields.inc.php

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.custom_fields.inc.php?cvsroot=phpgwapi&r1=1.6&r2=1.7

Patches:
Index: class.custom_fields.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/class.custom_fields.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- class.custom_fields.inc.php 9 Oct 2006 07:01:59 -0000       1.6
+++ class.custom_fields.inc.php 9 Oct 2006 13:26:55 -0000       1.7
@@ -8,7 +8,7 @@
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package phpgwapi
-       * @version $Id: class.custom_fields.inc.php,v 1.6 2006/10/09 07:01:59 
skwashd Exp $
+       * @version $Id: class.custom_fields.inc.php,v 1.7 2006/10/09 13:26:55 
sigurdne Exp $
        */
 
        /**
@@ -79,7 +79,7 @@
                        $this->location = $location;
                
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->db           =& $GLOBALS['phpgw']->db;
+                       $this->db           = clone($GLOBALS['phpgw']->db); // 
clone to awoid conflict the db in lang-function
                        $this->join                     = $this->db->join;
                        $this->like                     = $this->db->like;
 
@@ -100,7 +100,7 @@
                        $attrib['column_name'] = 
$this->db->db_addslashes($attrib['column_name']);
                        $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
                        $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
+                       $attrib['default'] = 
$this->db->db_addslashes((isset($attrib['default'])?$attrib['default']:''));
                        $this->db->transaction_begin();
 
                        $sql = 'SELECT MAX(attrib_sort) AS max_sort, MAX(id) AS 
current_id FROM phpgw_cust_attribute'
@@ -460,26 +460,26 @@
                                $ordermethod = ' ORDER BY attrib_sort ASC';
                        }
 
+                       $querymethod = '';
                        if($query)
                        {
-                               $query = $this->db->db_addslashes($query);
-                               $querymethod = " AND (phpgw_cust_attribute.name 
$this->like '%$query%' or phpgw_cust_attribute.descr $this->like '%$query%')";
+                               $querymethod = " AND 
(phpgw_cust_attribute.column_name $this->like '%$query%' or 
phpgw_cust_attribute.input_text $this->like '%$query%')";
                        }
 
                        $sql = "FROM phpgw_cust_attribute WHERE 
appname='$appname' AND location = '$location' ";
                        if ( $allrows )
                        {
-                               $this->db->query("SELECT * $sql" . 
$ordermethod, __LINE__, __FILE__);
+                               $this->db->query("SELECT * $sql" . $querymethod 
. $ordermethod, __LINE__, __FILE__);
                        }
                        else
                        {
-                               $this->db->limit_query("SELECT * $sql" . 
$ordermethod,$start, __LINE__, __FILE__);
+                               $this->db->limit_query("SELECT * $sql" . 
$querymethod . $ordermethod,$start, __LINE__, __FILE__);
                        }
 
                        $attribs = array();
                        while ($this->db->next_record())
                        {
-                               echo '<br>found: ' . 
$this->db->f('column_name');
+                               //echo '<br>found: ' . 
$this->db->f('column_name');
                                $attribs[] = array
                                (
                                        'id'                            => 
$this->db->f('id'),
@@ -520,6 +520,7 @@
                                }
                        }
 
+
                        return $attribs;
                }
 
@@ -549,6 +550,7 @@
                                $attrib['list']                                 
        = $this->db->f('list');
                                $attrib['search']                               
        = $this->db->f('search');
                                $attrib['history']                              
        = $this->db->f('history');
+                               $attrib['location']                             
        = $this->db->f('location');
                                
                                if ( $inc_choices 
                                        && ( $this->db->f('datatype') == 'R' 
@@ -689,8 +691,8 @@
                function resort_attrib($id, $resort, $appname, $location)
                {
                        $resort         = $resort == 'down' ? 'down' : 'up';
-                       $appname        = $this->db_db_addslashes($appname);
-                       $location       = $this->db_db_addslashes($location);
+                       $appname        = $this->db->db_addslashes($appname);
+                       $location       = $this->db->db_addslashes($location);
                        $id                     = (int) $id;
 
                        $this->db->transaction_begin();




reply via email to

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