mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-26 15:11:45 +01:00
Add initial framework for alternate contact types (not enabled), cleanup formatting
This commit is contained in:
parent
ac7a91b8fa
commit
bbbd26dc4b
@ -136,6 +136,10 @@
|
||||
|
||||
if($tsvfile['type'] == 'application/zip')
|
||||
{
|
||||
if(!@function_exists('zip_open'))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
$fp = $this->unzip($tsvfile['tmp_name'],$contacts->type);
|
||||
}
|
||||
else
|
||||
|
@ -82,15 +82,15 @@
|
||||
$this->use_session = True;
|
||||
}
|
||||
/* _debug_array($_POST); */
|
||||
/* Might change this to '' at the end---> */
|
||||
$_start = get_var('start',array('POST','GET'));
|
||||
$_query = get_var('query',array('POST','GET'),'_UNSET_');
|
||||
$_cquery = get_var('cquery', array('GET','POST'),'_UNSET_');
|
||||
$_sort = get_var('sort',array('POST','GET'));
|
||||
$_order = get_var('order',array('POST','GET'));
|
||||
$_filter = get_var('filter',array('POST','GET'));
|
||||
$_cat_id = get_var('cat_id',array('POST','GET'));
|
||||
// $_cat_id = get_var('cat_id',array('POST','GET'));
|
||||
$_fcat_id = get_var('fcat_id',array('POST','GET'));
|
||||
$_typeid = get_var('typeid',array('POST','GET'),'_UNSET_');
|
||||
|
||||
if(!empty($_start) || ($_start == '0') || ($_start == 0))
|
||||
{
|
||||
@ -111,6 +111,15 @@
|
||||
$this->cquery = $_cquery;
|
||||
}
|
||||
|
||||
if($_typeid != '_UNSET_')
|
||||
{
|
||||
$this->typeid = $_typeid;
|
||||
}
|
||||
if(!@in_array($this->typeid,array('n','c')))
|
||||
{
|
||||
$this->typeid = 'n';
|
||||
}
|
||||
|
||||
if(isset($_POST['fcat_id']) || isset($_POST['fcat_id']))
|
||||
{
|
||||
$this->cat_id = $_fcat_id;
|
||||
@ -120,6 +129,17 @@
|
||||
$this->cat_id = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
if(isset($_POST['typeid']) || isset($_POST['typeid']))
|
||||
{
|
||||
$this->typeid = $typeid;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->typeid = 'n';
|
||||
}
|
||||
*/
|
||||
|
||||
if(isset($_sort) && !empty($_sort))
|
||||
{
|
||||
if($this->debug) { echo '<br>overriding $sort: "' . $this->sort . '" now "' . $_sort . '"'; }
|
||||
@ -139,11 +159,6 @@
|
||||
}
|
||||
|
||||
if($this->debug) { $this->_debug_sqsof(); }
|
||||
|
||||
$this->xmlrpc_methods[] = array(
|
||||
'name' => 'read_entries',
|
||||
'description' => 'Get list of addressbook items'
|
||||
);
|
||||
}
|
||||
|
||||
function _debug_sqsof()
|
||||
@ -156,69 +171,13 @@
|
||||
'sort' => $this->sort,
|
||||
'order' => $this->order,
|
||||
'filter' => $this->filter,
|
||||
'cat_id' => $this->cat_id
|
||||
'cat_id' => $this->cat_id,
|
||||
'typeid' => $this->typeid
|
||||
);
|
||||
echo '<br>BO:';
|
||||
_debug_array($data);
|
||||
}
|
||||
|
||||
function list_methods($_type='xmlrpc')
|
||||
{
|
||||
/*
|
||||
This handles introspection or discovery by the logged in client,
|
||||
in which case the input might be an array. The server always calls
|
||||
this function to fill the server dispatch map using a string.
|
||||
*/
|
||||
if(is_array($_type))
|
||||
{
|
||||
$_type = $_type['type'] ? $_type['type'] : $_type[0];
|
||||
}
|
||||
switch($_type)
|
||||
{
|
||||
case 'xmlrpc':
|
||||
$xml_functions = array(
|
||||
'read' => array(
|
||||
'function' => 'read_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Read a single entry by passing the id and fieldlist.')
|
||||
),
|
||||
'add' => array(
|
||||
'function' => 'add_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Add a single entry by passing the fields.')
|
||||
),
|
||||
'save' => array(
|
||||
'function' => 'update_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Update a single entry by passing the fields.')
|
||||
),
|
||||
'delete' => array(
|
||||
'function' => 'delete_entry',
|
||||
'signature' => array(array(xmlrpcInt,xmlrpcInt)),
|
||||
'docstring' => lang('Delete a single entry by passing the id.')
|
||||
),
|
||||
'read_list' => array(
|
||||
'function' => 'read_entries',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Read a list of entries.')
|
||||
),
|
||||
'list_methods' => array(
|
||||
'function' => 'list_methods',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcString)),
|
||||
'docstring' => lang('Read this list of methods.')
|
||||
)
|
||||
);
|
||||
return $xml_functions;
|
||||
break;
|
||||
case 'soap':
|
||||
return $this->soap_functions;
|
||||
break;
|
||||
default:
|
||||
return array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function save_sessiondata($data)
|
||||
{
|
||||
if($this->use_session)
|
||||
@ -241,6 +200,7 @@
|
||||
$this->order = $data['order'];
|
||||
$this->filter = $data['filter'];
|
||||
$this->cat_id = $data['cat_id'];
|
||||
$this->typeid = $data['typeid'];
|
||||
if($this->debug) { echo '<br>read_sessiondata();'; $this->_debug_sqsof(); }
|
||||
}
|
||||
|
||||
@ -465,5 +425,63 @@
|
||||
|
||||
$GLOBALS['phpgw']->preferences->save_repository(True);
|
||||
}
|
||||
|
||||
function list_methods($_type='xmlrpc')
|
||||
{
|
||||
/*
|
||||
This handles introspection or discovery by the logged in client,
|
||||
in which case the input might be an array. The server always calls
|
||||
this function to fill the server dispatch map using a string.
|
||||
*/
|
||||
if(is_array($_type))
|
||||
{
|
||||
$_type = $_type['type'] ? $_type['type'] : $_type[0];
|
||||
}
|
||||
switch($_type)
|
||||
{
|
||||
case 'xmlrpc':
|
||||
$xml_functions = array(
|
||||
'read' => array(
|
||||
'function' => 'read_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Read a single entry by passing the id and fieldlist.')
|
||||
),
|
||||
'add' => array(
|
||||
'function' => 'add_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Add a single entry by passing the fields.')
|
||||
),
|
||||
'save' => array(
|
||||
'function' => 'update_entry',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Update a single entry by passing the fields.')
|
||||
),
|
||||
'delete' => array(
|
||||
'function' => 'delete_entry',
|
||||
'signature' => array(array(xmlrpcInt,xmlrpcInt)),
|
||||
'docstring' => lang('Delete a single entry by passing the id.')
|
||||
),
|
||||
'read_list' => array(
|
||||
'function' => 'read_entries',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
'docstring' => lang('Read a list of entries.')
|
||||
),
|
||||
'list_methods' => array(
|
||||
'function' => 'list_methods',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcString)),
|
||||
'docstring' => lang('Read this list of methods.')
|
||||
)
|
||||
);
|
||||
return $xml_functions;
|
||||
break;
|
||||
case 'soap':
|
||||
return $this->soap_functions;
|
||||
break;
|
||||
default:
|
||||
return array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -3,12 +3,12 @@
|
||||
* eGroupWare API - Palm Database Access *
|
||||
* This file written by Miles Lott <milos@groupwhere.org> *
|
||||
* Access to palm OS database structures (?) *
|
||||
* -------------------------------------------------------------------------*
|
||||
* ------------------------------------------------------------------------ *
|
||||
* Portions of code from ToPTIP *
|
||||
* Copyright (C) 2000-2001 Pierre Dittgen *
|
||||
* This file is a translation of the txt2pdbdoc tool *
|
||||
* written in C Paul J. Lucas (plj@best.com) *
|
||||
* -------------------------------------------------------------------------*
|
||||
* ------------------------------------------------------------------------ *
|
||||
* This library may be part of the eGroupWare API *
|
||||
* ------------------------------------------------------------------------ *
|
||||
* This library is free software; you can redistribute it and/or modify it *
|
||||
|
@ -191,14 +191,12 @@
|
||||
$this->template->set_var('query',$this->query);
|
||||
$this->template->set_var('cat_id',$this->cat_id);
|
||||
$this->template->set_var('lang_import_instructions',lang('import_instructions'));
|
||||
$this->template->set_var('zip_note','');
|
||||
if(extension_loaded('zip'))
|
||||
{
|
||||
$this->template->set_var('zip_note',lang('zip_note'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('zip_note','');
|
||||
}
|
||||
|
||||
$this->template->set_var('lang_exported_file',lang('enter the path to the exported file here'));
|
||||
$this->template->set_var('lang_conv_type',lang('select the type of conversion'));
|
||||
$this->template->set_var('lang_mark_priv',lang('Mark records as private'));
|
||||
|
@ -48,6 +48,15 @@
|
||||
'address3' => 'address3'
|
||||
);
|
||||
|
||||
var $contact_types = array(
|
||||
'n' => 'People',
|
||||
'c' => 'Companies'
|
||||
);
|
||||
var $contact_type = array(
|
||||
'n' => 'Person',
|
||||
'c' => 'Company'
|
||||
);
|
||||
|
||||
function uiaddressbook()
|
||||
{
|
||||
$GLOBALS['phpgw']->country = CreateObject('phpgwapi.country');
|
||||
@ -73,6 +82,7 @@
|
||||
$this->order = $this->bo->order;
|
||||
$this->filter = $this->bo->filter;
|
||||
$this->cat_id = $this->bo->cat_id;
|
||||
$this->typeid = $this->bo->typeid;
|
||||
if($this->debug) { $this->_debug_sqsof(); }
|
||||
}
|
||||
|
||||
@ -86,7 +96,8 @@
|
||||
'sort' => $this->sort,
|
||||
'order' => $this->order,
|
||||
'filter' => $this->filter,
|
||||
'cat_id' => $this->cat_id
|
||||
'cat_id' => $this->cat_id,
|
||||
'typeid' => $this->typeid
|
||||
);
|
||||
echo '<br>UI:';
|
||||
_debug_array($data);
|
||||
@ -103,7 +114,8 @@
|
||||
'sort' => $this->sort,
|
||||
'order' => $this->order,
|
||||
'filter' => $this->filter,
|
||||
'cat_id' => $this->cat_id
|
||||
'cat_id' => $this->cat_id,
|
||||
'typeid' => $this->typeid
|
||||
);
|
||||
$this->bo->save_sessiondata($data);
|
||||
}
|
||||
@ -120,7 +132,7 @@
|
||||
{
|
||||
$select .= '<option value="">' . lang('Please Select') . '</option>'."\n";
|
||||
}
|
||||
// while(list($key,$val) = each($list))
|
||||
settype($list,'array');
|
||||
foreach($list as $key => $val)
|
||||
{
|
||||
$select .= '<option value="' . $key . '"';
|
||||
@ -132,7 +144,8 @@
|
||||
}
|
||||
|
||||
$select .= '</select>'."\n";
|
||||
$select .= '<noscript><input type="submit" name="' . $name . '_select" value="True"></noscript>' . "\n";
|
||||
$select .= '<noscript><input type="submit" name="' . $name . '_select" value="'
|
||||
. lang('Submit') . '"></noscript>' . "\n";
|
||||
|
||||
return $select;
|
||||
}
|
||||
@ -408,7 +421,7 @@
|
||||
Set qfilter to display entries where tid=n (normal contact entry),
|
||||
else they may be accounts, etc.
|
||||
*/
|
||||
$qfilter = 'tid=n';
|
||||
$qfilter = 'tid=' . (string)$this->typeid;
|
||||
switch($this->filter)
|
||||
{
|
||||
case 'blank':
|
||||
@ -483,6 +496,15 @@
|
||||
$GLOBALS['phpgw']->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_showing',$lang_showing);
|
||||
$GLOBALS['phpgw']->template->set_var('search_filter',$search_filter);
|
||||
/*
|
||||
$GLOBALS['phpgw']->template->set_var('lang_show',lang('Show') . ':');
|
||||
$GLOBALS['phpgw']->template->set_var('contact_type_list',$this->formatted_list('typeid',$this->contact_types,$this->typeid,False,True));
|
||||
$GLOBALS['phpgw']->template->set_var('self_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
*/
|
||||
$GLOBALS['phpgw']->template->set_var('lang_show','');
|
||||
$GLOBALS['phpgw']->template->set_var('contact_type_list','');
|
||||
$GLOBALS['phpgw']->template->set_var('self_url','');
|
||||
|
||||
$GLOBALS['phpgw']->template->set_var('cats',lang('Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
/* $GLOBALS['phpgw']->template->set_var('cats_link',$this->cat_option($this->cat_id)); */
|
||||
|
@ -22,6 +22,10 @@ function check_all(which)
|
||||
{lang_showing}
|
||||
<br>{searchreturn}
|
||||
{search_filter}
|
||||
<!-- <table width="95%" border="1" cellspacing="1" cellpadding="3">
|
||||
<form name="addr_type" action="{self_url}" method="POST">
|
||||
<tr bgcolor="{th_bg}"><td>{lang_show} {contact_type_list}</td></tr></form>
|
||||
</table>-->
|
||||
<table width="95%" border="1" cellspacing="1" cellpadding="3">
|
||||
<tr>{alphalinks}
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user