[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgroupware/ipc_test_suite/sources/app/class.ipc_no
From: |
nomail |
Subject: |
[Phpgroupware-cvs] phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php, 1.1.2.2 |
Date: |
Fri, 14 May 2004 20:39:45 +0200 |
Update of /phpgroupware/ipc_test_suite/sources/app
Modified Files:
Branch: Version-0_9_16-branch
class.ipc_notes.inc.php
date: 2004/05/14 18:39:45; author: mkaemmerer; state: Exp; lines: +65 -5
Log Message:
- new version from DS
=====================================================================
Index: phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php
diff -u phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php:1.1.2.1
phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php:1.1.2.2
--- phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php:1.1.2.1
Mon Apr 5 19:42:00 2004
+++ phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php Fri May
14 18:39:45 2004
@@ -54,7 +54,15 @@
'BODY' => 'content'
),
'text/plain' => array('content'),
- 'text/xml' => array()
+ 'x-phpgroupware/search-index-data-item' =>
array(
+ // extern <> intern
+ 'note_id' => 'id',
+ 'note_owner' => 'owner',
+ 'note_access' => 'access',
+ 'note_createdate' => 'date',
+ 'note_category' => 'category',
+ 'note_description' => 'content'
+ )
);
}
@@ -122,9 +130,10 @@
* The optional lastmod parameter allows a limitations of the
data id list.
* The list contains all the id's of the modified data since the
passed lastmod timestamp.
* @param integer $lastmod last modification time, default is -1
and means return all data id's
+ * @param string $restriction restrict the result for a special
use of the id list. The possible restrictions are 'syncable' or 'searchable'.
When using 'syncable' only person ids will be returned in the result.
'searchable' returns all ids for both persons and orgs without check the owner.
Otherwise no restriction will be used and the result contains all ids for both
persons and orgs from the owner.
* @return array list of data id's
*/
- function getIdList($lastmod=-1)
+ function getIdList($lastmod=-1, $restriction='')
{
$idList = array();
@@ -362,12 +371,23 @@
$keyIntern = $this->map[$type][0];
$dataExtern = $dataIntern[$keyIntern];
break;
- case 'text/xml':
- return false;
+ case 'x-phpgroupware/search-index-data-item':
+ $dataExtern = array();
+ foreach($this->map[$type] as $keyExtern
=> $keyIntern)
+ {
+ if
(isset($dataIntern[$keyIntern]) == true)
+ {
+ $dataExtern[$keyExtern] =
$dataIntern[$keyIntern];
+ }
+ else
+ {
+ $dataExtern[$keyExtern]
= null;
+ }
+ }
+ $dataExtern =
$this->_export_index_data_item($dataExtern);
break;
default:
return false;
- break;
}
return $dataExtern;
}
@@ -466,5 +486,45 @@
return $data;
}
+ function &_export_index_data_item($fields)
+ {
+ $index_xml_item = CreateObject('search.index_xml_item',
'notes', $fields['note_id']);
+
+
$index_xml_item->setDisplayName($fields['note_description']);
+
+ $index_xml_item->setPriority($fields['todo_priority']);
+
+ $catId =
$fields['note_category']?$fields['note_category']:'';
+ $catName = '';
+ $index_xml_item->setCategory($catId, $catName);
+
+ $ownerId = $fields['note_owner'];
+ $groupId = '';
+ $visibilty = $fields['note_access'];
+ $index_xml_item->setAccess($ownerId, $groupId,
$visibilty);
+
+ $created = $fields['note_createdate'];
+ $modified = '';
+ $lastAccess = '';
+ $index_xml_item->setTimestamp($created, $modified,
$lastAccess);
+
+ // create csv file string
+ $csv = implode(',', array_keys($fields));
+ $csv .= "\r\n";
+
+ $values = array_values($fields);
+ for($i=0; $i<count($values); ++$i)
+ {
+ if($i>0)
+ $csv .= ",";
+ $csv .= str_replace(",", "\,",
addslashes($values[$i]));
+ }
+ $csv .= "\r\n";
+
+ $index_xml_item->setContent($csv, 'text/csv', '1.0');
+ $index_xml_item->setContentTransferEncoding('base64');
+
+ return $index_xml_item;
+ }
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgroupware/ipc_test_suite/sources/app/class.ipc_notes.inc.php, 1.1.2.2,
nomail <=