mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Addressbook: allow eg. telephone apps to jump directly into CRM view of a phonenumber with https://domain.com/egroupware/index.php?menuaction=addressbook.addressbook_ui.view&search="49 123 456789"&ajax=true&cd=yes
This commit is contained in:
parent
50ed21bd7e
commit
3253b6bda1
@ -2515,6 +2515,24 @@ window.egw_LAB.wait(function() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// allow to search eg. for a phone number
|
||||||
|
if (isset($_GET['search']))
|
||||||
|
{
|
||||||
|
$query = egw_session::appsession('index', 'addressbook');
|
||||||
|
$query['search'] = $_GET['search'];
|
||||||
|
unset($_GET['search']);
|
||||||
|
// reset all filters
|
||||||
|
unset($query['advanced_search']);
|
||||||
|
$query['col_filter'] = array();
|
||||||
|
$query['filter'] = $query['filter2'] = $query['cat_id'] = '';
|
||||||
|
egw_session::appsession('index', 'addressbook', $query);
|
||||||
|
$query['start'] = 0;
|
||||||
|
$query['num_rows'] = 1;
|
||||||
|
$rows = $readonlys = array();
|
||||||
|
$num_rows = $this->get_rows($query, $rows, $readonlys, true);
|
||||||
|
$_GET['contact_id'] = array_shift($rows);
|
||||||
|
$_GET['index'] = 0;
|
||||||
|
}
|
||||||
$contact_id = $_GET['contact_id'] ? $_GET['contact_id'] : ((int)$_GET['account_id'] ? 'account:'.(int)$_GET['account_id'] : 0);
|
$contact_id = $_GET['contact_id'] ? $_GET['contact_id'] : ((int)$_GET['account_id'] ? 'account:'.(int)$_GET['account_id'] : 0);
|
||||||
if(!$contact_id || !is_array($content = $this->read($contact_id)))
|
if(!$contact_id || !is_array($content = $this->read($contact_id)))
|
||||||
{
|
{
|
||||||
@ -2522,7 +2540,7 @@ window.egw_LAB.wait(function() {
|
|||||||
'menuaction' => 'addressbook.addressbook_ui.index',
|
'menuaction' => 'addressbook.addressbook_ui.index',
|
||||||
'msg' => $content,
|
'msg' => $content,
|
||||||
'ajax' => 'true'
|
'ajax' => 'true'
|
||||||
));
|
)+(isset($_GET['search']) ? array('search' => $_GET['search']) : array()));
|
||||||
}
|
}
|
||||||
if (isset($_GET['index']))
|
if (isset($_GET['index']))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user