[21032] This code need to be fixed, or better : removed, fix typos in it

Caeies <[email protected]> Wed, 10 Feb 2010 14:12:12 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 21032
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=21032
Author:   Caeies
Date:     2010-02-10 14:12:12 +0000 (Wed, 10 Feb 2010)
Log Message:
-----------
This code need to be fixed, or better : removed, fix typos in it

Modified Paths:
--------------
    modules/phpgwapi/trunk/inc/class.contacts_sql.inc.php

Modified: modules/phpgwapi/trunk/inc/class.contacts_sql.inc.php
===================================================================
--- modules/phpgwapi/trunk/inc/class.contacts_sql.inc.php	2010-02-10 14:11:24 UTC (rev 21031)
+++ modules/phpgwapi/trunk/inc/class.contacts_sql.inc.php	2010-02-10 14:12:12 UTC (rev 21032)
@@ -893,13 +893,17 @@
 		* @return array Array with database fields
 		* @deprecated
 		* @access private
-		*/
+		 */
+		//XXX Caeies 10: This method looks totaly unusable ...
 		function read($start=0,$limit=0,$fields='',$query='',$filter='',$sort='',$order='', $lastmod=-1)
 		{
+			//XXX If you use this method, please fix it, submit a patch, I will be happy to commit it. Caeies.
+			trigger_error("unsuable method called (contatcts_sql::read), please fix it !", E_USER_NOTICE);
+
 			foreach($fields as $field)
 			{
 				// we need search for a this communication media
-				if(@array_key_exists($field, $comm_old))
+				if(@array_key_exists($field, $this->comm_old))
 				{
 					$comms[] = array($field, 'comm_descr');
 					unset($fields[$field]);
@@ -2681,7 +2685,7 @@
 			$note['note_creaton'] = $this->get_mkdate();
 			$note['note_modon'] = $this->get_mkdate();
 
-			unset($comm['key_note_id']);
+			//unset($comm['key_note_id']);
 
 			return $this->_add($note,'note','note_contact_id',$cid,$action);
 		}
@@ -3328,7 +3332,7 @@
 			$this->request('contact_id');
 			$this->request($data);
 			$this->criteria(array('my_person_id' => $person_id));
-			return $this->get_query($aciton, __LINE__, __FILE__);
+			return $this->get_query($action, __LINE__, __FILE__);
 		}
 
 		/**
@@ -3618,7 +3622,7 @@
 			}
 
 			if( isset($search_fields['comm_media'])
-				&& is_array($search_fielss['comm_media'])
+				&& is_array($search_fields['comm_media'])
 				&& count($search_fields['comm_media']) > 0)
 			{
 				$search_fields_comms = $search_fields['comm_media'];
@@ -3685,7 +3689,7 @@
 			$records = $this->get_records(__LINE__, __FILE__);
 			if(is_array($records))
 			{
-				foreach($records as $key => $value)
+				foreach($records as $value)
 				{
 					$info[] = $value['contact_id'];
 				}
@@ -4031,7 +4035,7 @@
 		*/
 		function slice_old_fields($fields, $data_type)
 		{
-			foreach ($comm_old as $old_field => $value)
+			foreach ($this->comm_old as $old_field => $value)
 			{
 				if($fields[$old_field])
 				{
@@ -4173,7 +4177,7 @@
 
 			$person = $this->get_principal_persons_data($id);
 
-			$time = gettimeofday();
+			//$time = gettimeofday();
 			$uid = $person[0]['contact_id'].':'.$person[0]['per_full_name'];
 			$dn = 'uid=' . utf8_encode($uid).',' . $GLOBALS['phpgw_info']['server']['ldap_contact_context'];